Template:Formatnum/doc

From Wikimedia Commons, the free media repository
Jump to: navigation, search

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= }}

Template parameters

Parameter Description Default Status
1 number, that shall be formatted in local format (must be unformatted [without thousands separators]) empty required
2 language code (only needs to be provided if the language shall be fixed and independent 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 bytes 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:
Module:Formatnum

See also

{{Formatnum4}} for numbers 4 digits or shorter.

Localization

This template is not intended to be localized.

Examples

  • {{formatnum|100000}} → 100,000
  • {{formatnum|100000|sep=0}} → 100,000
  • {{formatnum|12345.67}} → 12,345.67
  • {{formatnum|-102}} → -102

Remark

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