C#: Rounding decimal numbers

Calculation results have to be rounded up to the nearest 0.05

thanks
quasar_eeAsked:
Who is Participating?
 
BuggyCoderCommented:
var result = 105.06;
result = Math.Round(Math.Round(result/0.05, 0)*0.05, 2);

Open in new window

0
 
Easwaran ParamasivamCommented:
Below method could be used.

Decimal.Round(YourValue, 2),
0
 
Easwaran ParamasivamCommented:
String round = YourValue.ToString("#0.00");
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.