• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Decimal-align

  • Template
  • Talk
  • Language
  • Watch
  • Edit
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:Decimal-align

Aligns numbers on the decimal point across multiple table cells within a row. Can wrap wikitext, including multi-cell outputs of {{convert}}.

Arguments

edit
Argument Meaning
1 (unnamed) cells to perform alignment on
leftx (optional, x = 1 to 10) alignment of the decimal point within column x, as a percentage of cell width
left (optional) default alignment of the decimal point if no "leftx" argument is given (defaults to 50%)

Example

edit

Default alignment:

{| class="wikitable sortable"
! Example # !! fl. oz. !! pints !! quarts !! gallons
|-
| 1 || {{decimal-align|{{convert|1|usoz|uspt usqt usgal|disp=tablecen}}}}
|-
| 2 || {{decimal-align|{{convert|10|usoz|uspt usqt usgal|disp=tablecen}}}}
|-
| 3 || {{decimal-align|{{convert|100|usoz|uspt usqt usgal|disp=tablecen}}}}
|}
Example # fl. oz. pints quarts gallons
1 1 0.063 0.031 0.0078
2 10 0.63 0.31 0.078
3 100 6.3 3.1 0.78

Explicit alignment of certain columns:

{| class="wikitable sortable"
! Example # !! fl. oz. !! pints !! quarts !! gallons
|-
| 1 || {{decimal-align|{{convert|1|usoz|uspt usqt usgal|disp=tablecen}}|left1=75|left4=25}}
|-
| 2 || {{decimal-align|{{convert|10|usoz|uspt usqt usgal|disp=tablecen}}|left1=75|left4=25}}
|-
| 3 || {{decimal-align|{{convert|100|usoz|uspt usqt usgal|disp=tablecen}}|left1=75|left4=25}}
|}
Example # fl. oz. pints quarts gallons
1 1 0.063 0.031 0.0078
2 10 0.63 0.31 0.078
3 100 6.3 3.1 0.78

See also

edit
  • Template:Decimal cell, similar template that operates on single table cells only and splits them into separate cells
The above documentation is transcluded from Template:Decimal-align/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Decimal-align&oldid=1234667017"
Last edited on 15 July 2024, at 14:46

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 15 July 2024, at 14:46 (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