# 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](user_settings.md#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_.<br><br>For example, a user with Swedish would see this number like 123 456,8<br><br>The number of 0’s after the decimal separator represents the _fixed_ positions of digits the field value will display. Rounding applies.<br><br>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.<br><br>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<br><br>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. |

> **Note:**
> 
> If no Number format is specified, the Number value is parsed according to the user’s locale:
> 
> -   Grouping spaces are removed.
>     
> -   If both "," and "." separators exist, the last separator is the decimal and all earlier separators will be grouping.
>     
> -   If only one separator exists:
>     
>     -   If it appears more than once, then all will be grouping.
>         
>     -   Otherwise:
>         
>         -   If the locale uses decimal "," (e.g., sv‑SE), a single comma is treated as decimal.
>             
>         -   If the locale uses decimal "." (e.g., en‑US), a single dot is treated as decimal.
>             
>         -   For the other separator, a 3‑digits‑after heuristic is used to decide grouping vs decimal.
>             
>         
>     
> 
> Examples:
> 
> 1.234.567,89 → 1234567.89
> 
> 1,234,567.89 → 1234567.89
> 
> 1 234 567,89 → 1234567.89
> 
> 1,234,567 → 1234567
> 
> 1.234.567 → 1234567
> 
> sv‑SE: 1,234 → 1.234
> 
> sv‑SE: 1.234 → 1234
> 
> en‑US: 1.234 → 1.234
> 
> en‑US: 1,234 → 1234
> 
> 1,23 → \`1.23
