Number format
This is an optional property available for Number fields in Form designer, meant to be set by administrators. With this, you can limit the number of decimals, set a fixed symbol, or simply remove the separators that are automatically set by the user’s language. Note that the format is only visual, i.e., the original number remains stored as is, and can be seen complete on editing mode.
In general, the syntax of the format must comply with the following:
-
Use of "0" as number
-
Use of "," and "." as thousand and decimal separators, respectively. May be set without separators.
-
Optional use of other elements (e.g., "#", "X", currency signs, etc., described below).
Given the number 123456.789 as example:
Format | Result (English language) | Remarks |
---|---|---|
0 |
123457 |
If no separators are specified, the number will be rounded to the nearest integer, with no format. |
0,0.0 |
123,456.8 |
Note that both types of separators will render according to the user’s language. For example, a user with Swedish would see this number like 123 456,8 The number of 0’s after the decimal separator represents the fixed positions of digits the field value will display. Rounding applies. Having 1.995, the result would be 2.0 |
0,0 |
123,457 |
Thousand and decimal separators can be used separately. |
0.0 |
123456.8 |
|
0.X |
123456.789 |
"X" displays all decimals precisely as they are, with no rounding. And, in this case, no format either. |
0,0.00 |
123,456.79 |
Having 1.995, the result would be 2.00 |
0,0.0000 |
123,456.7890 |
If the number of decimals is greater than the field value, it will pad with zeros. |
0.# |
123456.8 |
The number of #'s after the decimal separator represents the positions of digits the field value might display depending on the rounding. Having 1.995, the result would be 2 |
0,0.0# |
123,456.79 |
"0" and "#" can be combined to have a fixed number of decimals together with a variable result depending on the rounding Having 1.995, the result would be 2.0 |
0,0.## |
123,456.79 |
Having 1.995, the result would be 2 |
0.## % |
12345678.9 % |
Percentage of the number. |
0.00 % |
12345678.90 % |
|
'$' 0,0.00 |
$ 123,456.79 |
Currency symbol. |
0,0.00 SEK |
123,456.79 SEK |
Currency code. |
USD 0,0.0 |
USD 123,456.8 |
|
0,0.X € |
123,456.789 € |
|
0.000 km |
123456.789 km |
Unit of measurement. |
0.0° |
123456.8° |
|
0o |
1234567th |
The suffix of ordinal numbers. |