The ToString() is the important part. The "M" in the first line is just to signify this is a decimal number.
The "f" in "f1" means format like a number with no commas and n number of digits (1 in this case). The "n" in "n1" is the same, but formats using commas (or whatever your local thousands separater is).
If you need to do explicit rounding, use the Math.Round() function followed by a ToString.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.