Template:Formatnum/doc
This is a documentation subpage for Template:Formatnum. It contains usage information, categories, and other content that is not part of the original template page. |
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 | Typ | 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
[edit]{{Formatnum|1234}}
--> 1,234