The following symbols are used to create number patterns:
Symbol | Description | Example |
---|---|---|
0 | Use to specify a digit that must appear. For example, 0.00 would require input with a single digit before the decimal place, and two digits after. Similarly, #0.00 would allow one or more digits before the decimal place, and two digits after. | #0.00 |
@ | Use to specify the number of significant
digits to show. significant digits are the largest value digits in
the number. For example, in the number 12345, the 1 is the most significant,
the 2 is the second most, and so on. Typing that number into a template
of @@@ would produce the number 12300. A significant digit is always shown, even if its value is zero. Furthermore, you cannot use this symbol with a decimal value. |
@@@ |
# | Represents zero or more digits. For example, #.# would accept any of the following values: 1, 1.1, 0.1, or 123.34. | #.# |
. | Decimal separator. | #.# |
1-9 | Each number represents a digit that must
appear, and is used to set the increment for rounding. This means
that #5 would round the number to the nearest five. Similarly, #29
would round the number to the nearest multiple of 29. For example, if you set a pattern of #35 and the user typed 138, the number would be rounded to 140 (the nearest multiple of 35). |
#5 |
- | A negative indicator. Note that this is a placeholder for the characters defined in the negativeindicator setting. For example, if you defined your negative indicator as parentheses, then -#.# would result a value like: (123.45). | -#.# |
, | A separator indicator, representing the character used to separate increments of one thousand in numbers. Note that this is a placeholder for the characters defined in the separator setting. For example, if you declared your separator as a comma followed by a space, then 0,000 would result in a value like: 4, 000. | 0,000 |
\u00A4 | A currency indicator. Note that this
is a placeholder for the indicator defined in the currencylocale setting.
For example, if you declared your currencylocale to be the US, and
your template was \u00A4#0.00, you would get a value like: $534.23.
If this symbol appears twice, it is replaced by the international currency symbol. |
\u00A4#0.0 |
E | Separates the mantissa from the exponent
in scientific notation. For example, 0.#E# would result in a value
like: 1.23E4 Note that when using # in scientific notation, this represents the number of digits that will always appear after the decimal. So 0.# will result in one digit after the decimal, while 0.### will result in three digits. |
0.#E# |
+ | Use this to prefix positive exponents with the plus sign. For example, 0.#E+# would result in a value like: 1.34E+4. | 0.#E+# |
; | Separates the positive and negative versions of a pattern. For example, if you wanted a pattern of #.# or -#.#, you would declare: #.#;-#.# | #.#;-#.# |
% | Multiply the data by 100 and show as a percentage. For example, if you set a template of #% and entered a value of 0.12, you woud get: 12%. | #% |
\u2030 | Multiply the data by 1000 and show as per mille. For example, if you set a template of #.#\u2030 and entered a value of .123, you would get: 123 per mille. | #.#/u2030 |
* | Precedes a pad character, which you can use to insert specific symbols. For example, *0##.## would result in a value like: 012.23. | *0##.## |