قالب:Formatnum

Template documentation[view] [edit] [history] [purge]


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

Usage

{{Formatnum|1=|2=|sep=|prec=}}

Parameters

Parameter name Description Default value required or optional?

parameter #1 (1) number, that shall be formatted in local format (must be unformatted [without thousands separators]) empty required
parameter #2 (2) language code (only needs to be provided if the language shall be fixed and independant from the user's preferences) value of {{int:Lang}} optional
sep set to any non-empty value to remove thousands separators (e.g. for dates) empty optional
prec decimal place, minimal number of ciphers behind the decimal point to show, this needs to be set, if zeros at the end of the number shall be visible (0.100 will be converted to 0.1 without specifying this parameter) empty optional

Additional information

The template is intended to be used in the following namespaces: the Template namespace

The template is intended to be used by the following user groups: all users

Relies on:
{{FormatnumDigit}}, {{FormatnumSigns}}

Localization

This template is not intended to be localized.

Bugs

  • "{{formatnum}}12345.67" gives "12345.67" [1] (the result in this live example may depend on the server, but a result of 12,345.66 has been observed)

Remark

  • It is not compatible with tables sorting. The value is not detected as a number.

</incudeonly>