Numbers are stored internally as floating point values. Thus, if your data contains decimal values, make sure you include the decimal when you set Number typed properties. In other words, there is no equivalent MD2 format for Number types. Instead, the Number type uses an Excel-like syntax to format and round off its value.
You can use any characters in your formatting, but '#', '0', commas, and periods are reserved characters. Any other character is treated as a literal and is displayed as is. Thus, you may use literal characters in your format to prefix or suffix the data as you choose. If you need to use any reserved characters literally, then surround your literal text in single or double quotes. If you need to display quotes, place two of them side by side. The reserved characters are interpreted as follows:
Character | Displays |
---|---|
# | Significant Digits Only |
0 | Significant Digits or Insignificant Zeros |
comma | 1. If within the number, then commas separate every three digits |
2. If trailing the number, then the number is shown as an integer divided by 1000 for each trailing comma | |
period | Decimal point. The first decimal denotes the beginning of the fractional portion of the number. All subsequent decimals are treated as literals |
Here are some example number formats:
To Display | As | Use |
---|---|---|
1234.59 | 1234.6 | ####.# |
8.9 | 8.900 | #.000 |
.631 | 0.6 | 0.# |
44.398 | $44.40 | $0.00 |
1234.568 | $1,234.57 | $#,##0.00 |
5.25 | 5.25% | 0.00% |
12000 | 12,000 | #,### |
12000 | 12 | #, |
12200000 | 12.2 | 0.0,, |