Difference between revisions of "Template:Ordinal"

From Co-Optitude Wiki
Jump to navigation Jump to search
(Created page with "<noinclude> Usage: <pre> {{Ordinal|5}} </pre> Produces HTML: <pre> <span class="rsOrdinal"><span class="rsOrdinalNumber">5</span><span class="rsOrdinalSuffix">th</span></sp...")
 
 
Line 9: Line 9:
  
 
<pre>
 
<pre>
<span class="rsOrdinal"><span class="rsOrdinalNumber">5</span><span class="rsOrdinalSuffix">th</span></span>
+
<span class="rsOrdinal"><span class="rsOrdinalNumber">5</span><sup class="rsOrdinalSuffix">th</sup></span>
 
</pre>
 
</pre>
  
 
and the visual representation:
 
and the visual representation:
  
<span class="rsOrdinal"><span class="rsOrdinalNumber">5</span><span class="rsOrdinalSuffix">th</span></span>
+
<span class="rsOrdinal"><span class="rsOrdinalNumber">5</span><sup class="rsOrdinalSuffix">th</sup></span>
  
 
</noinclude><includeonly><!--
 
</noinclude><includeonly><!--
Line 22: Line 22:
 
   -->{{#ifexpr:({{{1}}} mod 10) = 2|{{#vardefine:ordinalSuffix|nd}}}}<!--
 
   -->{{#ifexpr:({{{1}}} mod 10) = 2|{{#vardefine:ordinalSuffix|nd}}}}<!--
 
   -->{{#ifexpr:({{{1}}} mod 10) = 3|{{#vardefine:ordinalSuffix|rd}}}}<!--
 
   -->{{#ifexpr:({{{1}}} mod 10) = 3|{{#vardefine:ordinalSuffix|rd}}}}<!--
-->}}<span class="rsOrdinal"><span class="rsOrdinalNumber">{{{1}}}</span><span class="rsOrdinalSuffix">{{#var:ordinalSuffix}}</span></span></includeonly>
+
-->}}<span class="rsOrdinal"><span class="rsOrdinalNumber">{{{1}}}</span><sup class="rsOrdinalSuffix">{{#var:ordinalSuffix}}</sup></span></includeonly>

Latest revision as of 06:44, 12 April 2020

Usage:

{{Ordinal|5}}

Produces HTML:

<span class="rsOrdinal"><span class="rsOrdinalNumber">5</span><sup class="rsOrdinalSuffix">th</sup></span>

and the visual representation:

5th