vb.net - Is format ####0.000000 different to 0.000000? -
i working on legacy code @ moment , have come across following:
foostring = string.format("{0:####0.000000}", foodouble)
my question is, format string here, ####0.000000
different 0.000000
?
i'm trying generalize return type of function sets foodouble
, checking make sure don't break existing functionality hence trying work out #
add here.
i've run couple tests in toy program , couldn't see how result different maybe there's i'm missing?
from msdn
the "#" custom format specifier serves digit-placeholder symbol. if value being formatted has digit in position "#" symbol appears in format string, digit copied result string. otherwise, nothing stored in position in result string.
note specifier never displays 0 not significant digit, if 0 digit in string. display 0 if significant digit in number being displayed.
because use 1 0 before decimal separator 0.0
- both formats should return same result.
Comments
Post a Comment