What is the difference between "#,#0.00" and "#,#.00"?
In the 2nd case, numbers between 0 and 1 won't have a leading 0. So, for example, "0.31" (1st string) will display as ".31" (2nd string):
http://msdn2.microsoft.com/en-us/library/ms146084.aspx
>>
0 | Represents a digit placeholder that displays a digit or a zero (0). If the number has a digit in the position where the zero appears in the format string, the formatted value displays the digit. Otherwise, the formatted value displays a zero in that position. If the number has fewer digits than there are zeros (on either side of the decimal) in the format string, the formatted value displays leading or trailing zeros. If the number has more digits to the right of the decimal separator than there are zeros to the right of the decimal separator in the format expression, the formatted value rounds the number to as many decimal places as there are zeros. If the number has more digits to the left of the decimal separator than there are zeros to the left of the decimal separator in the format expression, the formatted value displays the additional digits without modification. |
# | Represents a digit placeholder that displays a digit or nothing. If the expression has a digit in the position where the number sign (#) appears in the format string, the formatted value displays the digit. Otherwise, the formatted value displays nothing in that position. The number sign (#) placeholder works like the zero (0) digit placeholder except that leading and trailing zeros are not displayed if the number has the same or fewer digits than there are # characters on either side of the decimal separator in the format expression. |
>>
No comments:
Post a Comment