Number Formats
- Last UpdatedMar 12, 2021
- 3 minute read
Number formatting is used to convert a numeric value to a human readable string using culture specific settings.
Standard Numeric Formats
|
Format |
Description |
Example (for en-US) |
|
n |
Number |
n 1234.567 is displayed as 1,234.57 |
|
n0 10.12 is displayed as 10 |
||
|
n5 10.12 is displayed as 10.12000 |
||
|
c |
Currency |
c 1234.567 is displayed as $1,234.57 |
|
c0 1234.567 is displayed as $1,235 |
||
|
p |
Percentage |
p 0.222 is displayed as 22.20% |
|
p0 0.222 is displayed as 22% |
||
|
e |
Exponential |
e4 0.122 is displayed as 1.2200e-1 |
Custom Numeric Formats
Create custom numeric format string using one or more custom numeric specifiers.
|
Format |
Description |
Example (for en-US) |
|
0 |
Zero placeholder. Replaces the zero with the corresponding digit if one is present; otherwise, zero appears in the result string. |
00000 1234.5678 is displayed as 01235 |
|
# |
Digit placeholder. Replaces the hash sign with the corresponding digit if one is present; otherwise, no digit appears in the result string. Note: '#' specifier cannot be used to format a number as telephone number, that is (###)-###-####. |
##### 1234.5678 is displayed as 1235 |
|
. |
Decimal placeholder. Determines the location of the decimal separator in the result string. The '.' symbol is replaced with the localized decimal symbol. Note: You can set the decimal values only if the value in the Decimal Places box has been set to a number greater than 0. |
0.00 0.45678 is displayed as 0.46 |
|
, |
Group separator placeholder. Determines whether a group separator is required for a number. The ',' symbol is replaced with the localized group separator symbol. Note: |
##,# 12345678 is displayed as 12,345,678 |
|
% |
Percentage placeholder The '%' symbol is replaced with the localized percentage symbol. Note: '%' symbol is interpreted as a format specifier in the format string. If you need to prevent this, you will need to precede the '%' symbol with a '\'. |
|
|
$ |
Currency placeholder. The number is formatted based on the culture settings for currency in the current server. The $ symbol is replaced with the localized currency symbol. Note: ' |