Template:Ordinal/doc: Difference between revisions
Template page
More actions
m fix examples |
m remove extraneous vertical bar |
||
| Line 7: | Line 7: | ||
|2d=Presentation style. Different options for different languages: | |2d=Presentation style. Different options for different languages: | ||
* In English there is "style=d" adding ''-d'' suffixes to all numbers. Used in the legal field (e.g. ''3d'' or ''22d'') . | * In English there is "style=d" adding ''-d'' suffixes to all numbers. Used in the legal field (e.g. ''3d'' or ''22d'') . | ||
:''<code><nowiki>{{Ordinal|101 | :''<code><nowiki>{{Ordinal|101|lang=en|style=d}}</nowiki></code>'', for example, produces ''{{Ordinal|101|lang=en|style=d}}''. | ||
* In French you can use "style=roman" to display the number (in 1–5,000,000 range) as roman numeral. | * In French you can use "style=roman" to display the number (in 1–5,000,000 range) as roman numeral. | ||
:''<code><nowiki>{{Ordinal|21|lang=fr}}</nowiki></code>'', for example, produces ''{{Ordinal|21|lang=fr}}'' while ''<code><nowiki>{{Ordinal|21|lang=fr|style=roman}}</nowiki></code>'' produces ''{{Ordinal|21|lang=fr|style=roman}}''. | :''<code><nowiki>{{Ordinal|21|lang=fr}}</nowiki></code>'', for example, produces ''{{Ordinal|21|lang=fr}}'' while ''<code><nowiki>{{Ordinal|21|lang=fr|style=roman}}</nowiki></code>'' produces ''{{Ordinal|21|lang=fr|style=roman}}''. | ||
Revision as of 03:40, 30 December 2014
This template will add the appropriate ordinal suffix to a given integer.
{{Ordinal|101}}, for example, produces 101st.
In English version, for an integer ending in 2 or 3 (except for integers ending in 12 or 13), the ordinal suffix will be -nd and -rd, respectively.
Usage
{{Ordinal |1= |debug= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | positive integer number | empty | optional | |
style | Presentation style. Different options for different languages:
| empty | optional | |
gender | gender is used in French and Polish language versions. Genders: m for male, f for female and n for neuter. | m | optional | |
lang | language | {{int:Lang}} | optional | |
nosup | Set nosup=y to display the ordinals without superscript for links and category names. E.g. 101st instead of 101st. | empty | optional | |
debug | empty | optional | ||
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Examples
| Code | Result |
|---|---|
{{Ordinal|101}} |
101st |
{{Ordinal|102}} |
102nd |
{{Ordinal|103}} |
103rd |
{{Ordinal|104}} |
104th |
{{Ordinal|105|lang=en|style=d}} |
105d |
{{Ordinal|103|lang=pl}} |
103‑ci |
{{Ordinal|21|lang=fr|style=roman}} |
XXIe |