Character | Description |
None | Display the number with no formatting. |
0 | Digit placeholder. Display a digit or a zero. If the expression has a digit in the position where the 0 appears in the format string, display it; otherwise, display a zero in that position. |
# | Digit placeholder. Display a digit or nothing. If the expression has a digit in the position where the # appears in the format string, display it; otherwise, display nothing in that position. |
. | Decimal placeholder. In some locales, a comma is used as the decimal separator. |
% | Percentage placeholder. The expression is multiplied by 100. |
, | Thousand separator. In some locales, a period is used as a thousand separator. |
: | Time separator. In some locales, other characters might be used to represent the time separator. |
/ | Date separator. In some locales, other characters might be used to represent the date separator. |
(E- E+ e- e+) | Scientific format. If the format expression contains at least one digit placeholder (0 or #) to the right of E-, E+, e-, or e+, the number is displayed in scientific format and E or e is inserted between the number and its exponent. |
- + $ ( ) | Display a literal character. To display a character other than one of those listed, precede it with a backslash (\) or enclose it in double quotation marks (" "). |
\ | Display the next character in the format string. To display a character that has special meaning as a literal character, precede it with a backslash (\). The backslash itself isn't displayed. Using a backslash is the same as enclosing the next character in double quotation marks. To display a backslash, use two backslashes (\\). Examples of characters that can't be displayed as literal characters are the date-formatting and time-formatting characters (a, c, d, h, m, n, p, q, s, t, w, y, / and :), the numeric-formatting characters (#, 0, %, E, e, comma, and period), and the string-formatting characters (@, &, <, >, and !). |
"ABC" | Display the string inside the double quotation marks (" "). To include a string in format using VBA code, use Chr(34) to enclose the text in quotes (34 is the character code for a quotation mark). |
“I often say that when you can measure what you are speaking about, and express it in numbers, you know something about it; but when you cannot express it in numbers, your knowledge is of a meagre and unsatisfactory kind” ~ William Thomson (Lecture on Electrical Units of Measurement)
Related: