Difference between revisions of "Template:Ordinal"
Jump to navigation
Jump to search
Rocketsoup (talk | contribs) (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...") |
Rocketsoup (talk | contribs) |
||
Line 9: | Line 9: | ||
<pre> | <pre> | ||
− | <span class="rsOrdinal"><span class="rsOrdinalNumber">5</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="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="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