Difference between revisions of "Template:Formatnum"

From Kerbal Space Program Wiki
Jump to: navigation, search
(-get rid of /Core here;)
m (*replace 'Parameter Row' and 'ParameterRow' by 'Parameter row';)
Line 7: Line 7:
 
== Parameters ==
 
== Parameters ==
 
{{Parameter Table|parameters=
 
{{Parameter Table|parameters=
{{Parameter Row|1|Number to be formatted}}
+
{{Parameter row|1|Number to be formatted}}
{{Parameter Row|2|Number of decimal places.|0}}
+
{{Parameter row|2|Number of decimal places.|0}}
 
}}
 
}}
  

Revision as of 20:49, 26 November 2014

An language specific to the FormatNum extension. Uses a &thinsp; (thin space) as thousand separator and a decimal seperator depending on the language (see {{DS}}). It also places the number in a <span> with the CSS property white-space set to nowrap to avoid line breaks.

According to ISO 31-0 (and in German also DIN 1333, 5008) a space should be used as a thousand separator to avoid confusion with the decimal separator. This templates uses the Unicode 820110 (or 200916) which is a thin space.

To format a number without the <span>, for example in tool tips, use the following code: {{#formatnum:NUMBER|NUMBER OF DECIMAL PLACES|{{DS}}|t}}

Parameters

Template:Parameter Table

See also

  • {{Formatnum/SortCell}} automatically adds the data-sort-value and then calls this template