The following table contains some sample format expressions for numbers. (These examples all assume that your system's locale setting is English-U.S.) The first column contains the format strings; the other columns contain the output that results if the formatted data has the value given in the column headings.
Format (format) | Positive 5 | Negative 5 | Decimal .5 | Null |
---|---|---|---|---|
Zero-length string |
5 |
-5 |
0.5 |
|
0 |
5 |
-5 |
1 |
|
0.00 |
5.00 |
-5.00 |
0.50 |
|
#,##0 |
5 |
-5 |
1 |
|
#,##0.00;;;Nil |
5.00 |
-5.00 |
0.50 |
Nil |
$#,##0;($#,##0) |
$5 |
($5) |
$1 |
|
$#,##0.00;($#,##0.00) |
$5.00 |
($5.00) |
$0.50 |
|
0% |
500% |
-500% |
50% |
|
0.00% |
500.00% |
-500.00% |
50.00% |
|
0.00E+00 |
5.00E+00 |
-5.00E+00 |
5.00E-01 |
|
0.00E-00 |
5.00E00 |
-5.00E00 |
5.00E-01 |