Custom Number Field Display

A number pattern is a string of characters that consists of some combination of literal characters and symbols. A literal character is a character that will be displayed as you type it in the field format; a symbol will be replaced by the value or values it represents. The pattern determined by the combination of these will control how numbers are displayed in that field. In some cases, a symbol might indicate that a particular operation will be performed on the value for display purposes.

The table below lists the possible elements of a number pattern and the symbol used to represent them in the pattern. Examples are provided below the table.

Description Symbol
Digit 0
Rounding increment 1-9
Significant digit @
Digit, zero shown as absent #
Decimal separator or monetary decimal separator .
Minus sign -
Grouping separator ,
Separator between mantissa and exponent in scientific notation E
Prefix positive exponents with a localized plus sign +
Separator between positive and negative sub-patterns ;
Multiply by 100 and show as percentage %
Multiply by 1000 and show as per mille
Currency sign, replaced by currency symbol ¤
Currency sign, replaced by international currency symbol ¤¤
Currency sign, replaced by currency plural names (e.g., "US dollars") ¤¤¤
Quote special characters in prefix or suffic '
Pad character indicator *

Examples

Pattern User Input Display Value Notes
#,###,##0.0# 1234567.8 1,234,567.8 The character used to separate groups of digits depends on your local settings.  In some regions, a comma is used, as in the display value in this example, but in other regions another character (such as a period) might be used.
#,###,##0.0# -1234567.8 -1234,567.8 This pattern is identical to the above. If no special formatting is indicated for negative numbers, the same formatting as for positive numbers will be used, prepended with a minus sign.
###,##0.0;'('-###,##0.0')' 1234.5 1,234.5 If you want to display positive and negative numbers differently beyond simply adding a minus sign, you can separate a positive and negative pattern with a semicolon. This pattern contains both a positive and negative subpattern, and this example of user input demonstrates the handling for positive numbers, specified by the pattern before the ";" symbol.
###,##0.0;'('-###,##0.0')' -1234.5 (-1,234.5) As with the above example, this pattern specifies both a positive and negative display pattern. This example of user input demonstrates the handling for negative numbers, specified by the pattern after the ";" symbol. In this case, negative numbers are indicated by a minus sign before the value, and are contained within parentheses.
#1,000 1234567.8 1,234,570 The "100" preceding the final 0 in the string indicates that the value should be rounded to the nearest hundreds place. Note that the actual value set has not been lost; the server is still storing the entire value down to the tenth place. The rounded value is for display purposes only.
###,##0' kph' 55.5 55.5 kph The value in single quotes is a suffix. It is printed as-is and is not parsed, but provides additional information about the value (in this case, indicates that it is a speed in kilometers per hour).
#,###,###,###0.00 ¤¤¤ 1159.9 1,159.90 US Dollars The ¤ symbol written three times in a row indicates that the currency type should be written out in full.
*0#####0.0 1234.5 0012345.6 The "*0" string at the beginning of the pattern indicates that the character 0 should be used as a padding character if the input value is shorter than the number of digits specified. Since the pattern specifies six digits before the decimal point, two 0 characters are prepended to the string for display. This allows you to maintain consistent display lengths even for input numbers of varying lengths.
@@@ 1234.5 1230 The @ character indicates the number of significant digits to display. In this example, exactly three significant digits should be displayed. The entire number is saved on the server, but only the specified significant digits will be visible to users browsing the repository.
@@## 1234.5 1234 Combining the @ and # characters allows you to set a maximum and minimum number of significant digits to display. In this example and the next, a value will be displayed with no fewer than two or more than four significant digits. The input string for this example contains five digits, so the fifth is not displayed.
@@## 1 1.0 As in the above example, this pattern indicates that no fewer than two or more than four significant digits should be displayed. Thus, the value "1" will be displayed with two significant digits, as "1.0".
0.###E0 1234.5 1.234E3 Scientific notation is a way of expressing numbers as a combination of a mantissa (the significant digits of the number) and an exponent. This example displays a number in scientific notation with four significant digits.