Difference between revisions of "Template:Ordinal/doc"

From DoomWiki.org

(Documentation for template)
m (categorization)
(One intermediate revision by one other user not shown)
Line 23: Line 23:
<includeonly>[[Category:Templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>

Latest revision as of 02:37, 4 August 2017



This template will add the appropriate ordinal indicator to a given integer.

Use {{Ordinal|integer|sup=yes}} to display the ordinal suffix in superscript.

For an integer ending in 1, 2 or 3 (except for integers ending in 11, 12 or 13), the ordinal suffix will be -st, -nd and -rd, respectively. To display -d for the ordinal suffix rather than -nd and -rd, use {{Ordinal|positive integer|d}}.


Code Result
{{Ordinal|101}} 101st
{{Ordinal|-102}} -102nd
{{Ordinal|102|sup=yes}} 102nd
{{Ordinal|103}} 103rd
{{Ordinal|103|d}} 103d