How can I use String.Format
in C# so doubles are displayed like this:
Values:
-1.0
1.011
100.155
1000.25
11000.52221
displayed string:
-1.00
1.011
100.2
1000
11001
The main point is my width is fixed to 5 characters no matter what. I don't really care how many decimal places are shown to the right. If there are 4 or more numbers to the left of decimal I want everything right of the decimal to be dropped (including the decimal itself).
It seems like something that should be a pretty standard practice. But I'm not having much luck finding an answer that works.
A couple of corrections were made to the display string above, I do want rounding.
Thanks!