K
Ken Durden
Is it possible to force positive values to have the + sign prefixed on
them?
double f1 = 1024.2;
double f2 = -1024.2;
string.Format( "{0:F}", f1 ); // +1024.2
string.Format( "{0:F}", f2 ); // -1024.2
I was hoping for something either in the string.Format prefix, or
something in the NumberFormatInfo object, but I couldn't seem to find
it.
string.Format( "+{0:F}", f1 );
isn't really an option, because I'm trying to make a grid control
display floating points in this way, and I'm not dynamically
generating the text for each cell.
Thanks,
-ken
them?
double f1 = 1024.2;
double f2 = -1024.2;
string.Format( "{0:F}", f1 ); // +1024.2
string.Format( "{0:F}", f2 ); // -1024.2
I was hoping for something either in the string.Format prefix, or
something in the NumberFormatInfo object, but I couldn't seem to find
it.
string.Format( "+{0:F}", f1 );
isn't really an option, because I'm trying to make a grid control
display floating points in this way, and I'm not dynamically
generating the text for each cell.
Thanks,
-ken