Possible Duplicate:
Double.ToString with N Number of Decimal Places
I want to show a decimal to 6 decimal places, even if it contains 6 x 0's For example:
3.000000
5.100000
3.456789
and so forth, is this possible?
Use N6
as the numeric format string.
myDecimal.ToString("N6");
or
string.Format("{0:N6}", myDecimal);
Decimal d = 20;
d.ToString("0.000000");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With