(Import from en.Wikipedia.org) |
m (Add TemplateData) |
||
Line 1: | Line 1: | ||
<onlyinclude><includeonly>{{{1}}}<sup>{{#switch:{{#expr:abs({{{1}}}) mod 100}}|11|12|13=th|{{#switch:{{#expr:abs{{{1}}} mod 10}}|1=st|2=nd|3=rd|th}}}}</sup></includeonly></onlyinclude> | <onlyinclude><includeonly>{{{1}}}<sup>{{#switch:{{#expr:abs({{{1}}}) mod 100}}|11|12|13=th|{{#switch:{{#expr:abs{{{1}}} mod 10}}|1=st|2=nd|3=rd|th}}}}</sup></includeonly></onlyinclude> | ||
Simply adds the correct suffix to a number to indicate it is an ordinal, for example <code><nowiki>{{ordinal|3}}</nowiki></code> ⟶ {{ordinal|3}}, and <code><nowiki>{{ordinal|11}}</nowiki></code> ⟶ {{ordinal|11}}. | Simply adds the correct suffix to a number to indicate it is an ordinal, for example <code><nowiki>{{ordinal|3}}</nowiki></code> ⟶ {{ordinal|3}}, and <code><nowiki>{{ordinal|11}}</nowiki></code> ⟶ {{ordinal|11}}. | ||
{{TemplateData preamble}}<templatedata> | |||
{ | |||
"params": { | |||
"1": { | |||
"label": "Number", | |||
"type": "number" | |||
} | |||
}, | |||
"description": "Adds the correct English ordinal suffix to a number e.g. \"3\" to \"3rd\".", | |||
"format": "inline" | |||
} | |||
</templatedata> |
Latest revision as of 18:49, 30 October 2023
Simply adds the correct suffix to a number to indicate it is an ordinal, for example {{ordinal|3}}
⟶ 3rd, and {{ordinal|11}}
⟶ 11th.
The below documentation is automatically generated from JSON. It can be changed by editing this page, but note that it's only the documentation (for the visual editor)—the actual template part must also be edited, manually.
Adds the correct English ordinal suffix to a number e.g. "3" to "3rd".
Parameter | Description | Type | Status | |
---|---|---|---|---|
Number | 1 | no description | Number | optional |