number of decimal places

  • Thread starter Thread starter yo_mismo
  • Start date Start date
Y

yo_mismo

Hi all,

how can i get a number with only 3 decimals?

i'm trying this but doesn't work:

(number_1*number_2).ToString("####.000")

i don't know how to use very well 'ToString()'.

what's the diference between 'ToString("####.000")'(4 #'s) and
'ToString("#####.000")' (5 #'s)

thanks
 
Bruce Wood said:
Shouldn't that be

Math.Round(value,3).ToString("###,##0.###");
I think not: I have used ToString("###,###.###");
without any problems, the decimal being rouded OK.
 
Zach said:
I think not: I have used ToString("###,###.###");
without any problems, the decimal being rouded OK.

Yes, but if you format a 0 (zero) you'll get "" (String.Empty) ;)
 
Back
Top