Difference between revisions of "Template:0"

From MHWiki
(template to fix numerical sorting)
 
m (Typo)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<includeonly><span style="display:none">0{{{1|}}}</span></includeonly>
+
<includeonly><span style="display:none">0{{{1|}}}</span></includeonly><noinclude>
 
 
 
A template for left padding of hidden leading zeros to force numerical sorting in tables.
 
A template for left padding of hidden leading zeros to force numerical sorting in tables.
  
Line 8: Line 7:
  
 
===Examples===
 
===Examples===
*If the the largest number is xxx,xxx ''[, ...]''
+
*If the largest number is xxx,xxx ''[, ...]''
 
**Add <nowiki>{{0}}</nowiki> in front of xx,xxx
 
**Add <nowiki>{{0}}</nowiki> in front of xx,xxx
 
**Add <nowiki>{{0|0}}</nowiki> in front of x,xxx
 
**Add <nowiki>{{0|0}}</nowiki> in front of x,xxx
 
**Add <nowiki>{{0|00,}}</nowiki> in front of xxx
 
**Add <nowiki>{{0|00,}}</nowiki> in front of xxx
  
*If the the largest number is xx,xxx ''[, ...]''
+
*If the largest number is xx,xxx ''[, ...]''
 
**Add <nowiki>{{0}}</nowiki> in front of x,xxx
 
**Add <nowiki>{{0}}</nowiki> in front of x,xxx
 
**Add <nowiki>{{0|0,}}</nowiki> in front of xxx
 
**Add <nowiki>{{0|0,}}</nowiki> in front of xxx
 
**Add <nowiki>{{0|0,0}}</nowiki> in front of xx
 
**Add <nowiki>{{0|0,0}}</nowiki> in front of xx
  
*If the the largest number is x,xxx ''[, ...]''
+
*If the largest number is x,xxx ''[, ...]''
 
**Add <nowiki>{{0|,}}</nowiki> in front of xxx
 
**Add <nowiki>{{0|,}}</nowiki> in front of xxx
 
**Add <nowiki>{{0|,0}}</nowiki> in front of xx
 
**Add <nowiki>{{0|,0}}</nowiki> in front of xx
 
**Add <nowiki>{{0|,00}}</nowiki> in front of x
 
**Add <nowiki>{{0|,00}}</nowiki> in front of x
 +
</noinclude>

Latest revision as of 11:42, 25 August 2021

A template for left padding of hidden leading zeros to force numerical sorting in tables.

Usage

  • Using {{0}} will generate <span style="display:none">0</span>
  • Using {{0|foo}} will generate <span style="display:none">0foo</span>

Examples

  • If the largest number is xxx,xxx [, ...]
    • Add {{0}} in front of xx,xxx
    • Add {{0|0}} in front of x,xxx
    • Add {{0|00,}} in front of xxx
  • If the largest number is xx,xxx [, ...]
    • Add {{0}} in front of x,xxx
    • Add {{0|0,}} in front of xxx
    • Add {{0|0,0}} in front of xx
  • If the largest number is x,xxx [, ...]
    • Add {{0|,}} in front of xxx
    • Add {{0|,0}} in front of xx
    • Add {{0|,00}} in front of x