Template:Formatnum
Uses Lua: |
This template formats a number in the local format (local numerals, local thousands separator, decimal separator and the pattern of separators [some languages for example have a ten-thousands separator]) of the user's preferred language.
Parameter | Description | Type | Status | |
---|---|---|---|---|
number | 1 number | Number that will be formatted. It must be unformatted.
| Line | required |
language | 2 lang | Language code, only to be given if the language shall be fixed; by default the user interface language.
| Line | optional |
no separators | sep | Any non-empty value will remove thousands seperators. | Line | optional |
precision | prec | The number of decimal digits to show. If given as a positive number, exactly that many decimal digits will be shown, and the number will be truncated (not rounded!) or zero-padded if needed. If not given or it's nonpositive, all decimal digits will be shown, except for trailing zeros.
| Number | optional |
Examples
{{Formatnum|1234}}
--> 1,234
The above documentation is transcluded from Template:Formatnum/doc (edit | history). Editors can experiment in this template's sandbox (create | mirror) and testcases (create) page. Please add categories to the /doc subpage. Subpages of this template. |