• Home
  • Random
  • Nearby
  • Log in
  • Settings
  • Donate
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:0/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:0
This is the template sandbox page for Template:0 (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 50,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.

Contents

  • 1 Usage
  • 2 Examples
  • 3 See also
  • 4 TemplateData

Usage

edit

This template inserts an invisible (visibility:hidden and color:transparent) zero (0) character. It is used for padding statistics and other numbers in table columns so that they line up properly.

The invisible zero may in fact be replaced by any other string (which regardless, is made invisible), by specifying the string as the first optional parameter. This is useful to "visually pad out" equivalent length rows in numeric columns in such tables. This is accomplished by inserting extra invisible zeroes, thousands separators, or decimal points prefixing and suffixing the numeric field, (adjusted to pad to the length of the largest numeric value) like in example one.

Examples

edit
Input Displays as

{{0|00,0}}12{{0|.00}} km
{{0|00,0}}24.{{0|00}} km
{{0|00,}}212.5{{0|0}} km
{{0|0}}3,212.51 km
{{0|}}16,789.01 km
20,111.05 km

00,012.00 km
00,024.00 km
00,212.50 km
03,212.51 km
16,789.01 km
20,111.05 km

Note: The null template, {{0|}}, used in the second to last line, produces the same alignment effect as omitting the template entirely. However, the null template can be useful for preserving the alignment within the wikicode.

Note also OpenType fonts feature tnum/pnum CSS font-variant-numeric:tabular-nums, font-variant-numeric:proportional-nums, U+2007   FIGURE SPACE (&numsp;), U+2008   PUNCTUATION SPACE (&puncsp;) and U+2012 ‒ FIGURE DASH.

This template is smarter than {{padleft:}} magic word; also MediaWiki: Help:Magic_words § Formatting.

See also

edit
  • {{Nothing}}
  • {{Void}}

TemplateData

edit
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:0 in articles based on its TemplateData.

TemplateData for 0

This template inserts an invisible (visibility:hidden and color:transparent) zero (0) character. It is used for padding statistics and other numbers in table columns so that they line up properly. The invisible zero may in fact be replaced by any other string (which regardless, is made invisible), by specifying the string as the first optional parameter. This is useful to "visually pad out" equivalent length rows in numeric columns in such tables. This is accomplished by inserting extra invisible zeroes, thousands separators, or decimal points prefixing and suffixing the numeric field, (adjusted to pad to the length of the largest numeric value).

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Hidden string1

no description

Default
0
Example
00,0
Stringoptional
The above documentation is transcluded from Template:0/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wiki.x.io/w/index.php?title=Template:0/sandbox&oldid=930938300"
Last edited on 15 December 2019, at 23:51

Languages

      This page is not available in other languages.

      Wikipedia
      • This page was last edited on 15 December 2019, at 23:51 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop