Restrict decimal points to two decimal places in C#

Last Reply on Jul 06, 2014 09:34 AM By Azim

Posted on Jul 06, 2014 09:33 AM

i need the two digits after the point

 

10000/30=333.33333333

 

 

i need 333.33 

You are viewing reply posted by: Azim on Jul 06, 2014 09:34 AM.
Posted on Jul 06, 2014 09:34 AM

Use Math.Round

C#

double d = 333.33333333;
double twoDecimal = Math.Round(d, 2);