I tried all these different format specifiers but none of them were supported. Also I would love to see all of the format specifiers that are supported if anyone knows where they are.
This works though:
double zero = 0.0;
string intermediate = zero.ToString("F2");
string result = "0" + intermediate;
So if you like this workaround you may want to consider StringBuilder if it’s an option. I never work with strings but apparently they can slow down performance when not concatenating with StringBuilder.
You would have to decide how to handle negatives and what the range of possible values is.
I’m imaging it could be -9.99 through 99.99 and if a value is > 0. AND < 10.0 then you tack on a leading 0.
EDIT: or test for length… Mike’s got the better idea.