Format a double to two digits after the comma without rounding up or down
I have been searching forever and I simply cannot find the answer, none of
them will work properly.
I want to turn a double like 0.33333333333 into 0,33 or 0.6666666666 into
0,66
Number like 0.9999999999 should become 1 though.
I tried various methods like
value.ToString("##.##", System.Globalization.CultureInfo.InvariantCulture)
It just returns garbage or rouns the number wrongly. Any help please?
No comments:
Post a Comment