Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Ordinal/doc: Difference between revisions

Template page
No edit summary
No edit summary
 
(23 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Lua|Module:Ordinal}}
{{TemplateBox
{{TemplateBox
|1=1
|1=1
Line 7: Line 8:
|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|d}}</nowiki></code>'', for example, produces ''{{Ordinal|101|d}}''.
:''<code><nowiki>{{Ordinal|101|lang=en|style=d}}</nowiki></code>'', for example, produces ''{{Ordinal|101|lang=en|style=d}}''.
* In French "style=roman" presenting the number 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}}''.
* In French you can use "style=roman-title" to display the number as a roman numeral with no suffix except for 1st.
:For example, ''<code><nowiki>{{Ordinal|1|lang=fr|style=roman-title}}</nowiki></code>'' produces ''{{Ordinal|1|lang=fr|style=roman-title}}'' but ''<code><nowiki>{{Ordinal|3|lang=fr|style=roman-title}}</nowiki></code>'' produces ''{{Ordinal|3|lang=fr|style=roman-title}}''.
* In French you can use "style=pair" to display ordinals for numbers in a pair.
:For example, ''<code><nowiki>{{Ordinal|1|lang=fr|gender=m|style=pair}}</nowiki></code>'' produces ''{{Ordinal|1|lang=fr|gender=m|style=pair}}'' but ''<code><nowiki>{{Ordinal|2|lang=fr|gender=m|style=pair}}</nowiki></code>'' produces ''{{Ordinal|2|lang=fr|gender=m|style=pair}}''.
* In Tamil you can use "style=trad" to display traditional Tamil ordinals rather than modern Tamil ordinals.
:''<code><nowiki>{{Ordinal|1|lang=ta}}</nowiki></code>'', for example, produces ''{{Ordinal|1|lang=ta}}'' while ''<code><nowiki>{{Ordinal|1|lang=ta|style=trad}}</nowiki></code>'' produces ''{{Ordinal|1|lang=ta|style=trad}}''.
:''<code><nowiki>{{Ordinal|23|lang=ta}}</nowiki></code>'', for example, produces ''{{Ordinal|23|lang=ta}}'' while ''<code><nowiki>{{Ordinal|23|lang=ta|style=trad}}</nowiki></code>'' produces ''{{Ordinal|23|lang=ta|style=trad}}''.
|2def=
|2def=
|2stat=optional-
|2stat=optional-
|3=gender
|3=gender
|3d=gender is used in French and Polish language versions. Genders: m for male, f for female and n for neuter.
|3d=Gender affects ordinal indicators in several languages, including French and Polish. Genders: m for male, f for female and n for neuter.
|3def=m
|3def=
|3stat=optional-
|3stat=optional-
|4=lang
|4=lang
|4d=language
|4d=language code of the language in which to display the ordinal number, e.g. en for English, de for German, etc. 
|4def=<nowiki>{{int:Lang}}</nowiki>
|4def=<nowiki>{{int:Lang}}</nowiki>
|4stat=optional-
|4stat=optional-
|5=nosup
|5d=Set <code><nowiki>nosup=y</nowiki></code> to display the ordinals without superscript for links and category names. E.g. {{ordinal|101||lang=en|nosup=y}} instead of {{ordinal|101||lang=en}}.
|5def=
|5stat=optional-
|6=debug
|6desc=set to 1 if the template should return an error message when parameter 1 is not a numeral
|name=Ordinal
|name=Ordinal
|desc=This template will add the appropriate ordinal suffix to a given positive integer.
|desc=This template will add the appropriate ordinal suffix to a given integer.
:''<code><nowiki>{{Ordinal|101}}</nowiki></code>'', for example, produces ''{{Ordinal|101}}''.
:''<code><nowiki>{{Ordinal|101}}</nowiki></code>'', for example, produces ''{{Ordinal|101}}''.
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.
|namespace=all
|namespace=all
|usergroup=all
|usergroup=all
Line 32: Line 49:
|i18n-mediawiki-msg=
|i18n-mediawiki-msg=
|seealso=
|seealso=
* [[Module:Ordinal]]
* [[Module:I18n/ordinal]] — translations and ordinal formatting schemes used by Module:Ordinal
|setscats=
|setscats=
|lines=1
|lines=1
|shorthand=
|shorthand=
|relieson=
|relieson=[[Module:Ordinal]]
}}
}}
==Examples==
{| class="wikitable" border="1"
! Code !! Result
|-
| <code><nowiki>{{Ordinal|101}}</nowiki></code> || {{Ordinal|101}}
|-
| <code><nowiki>{{Ordinal|102}}</nowiki></code> || {{Ordinal|102}}
|-
| <code><nowiki>{{Ordinal|103}}</nowiki></code> || {{Ordinal|103}}
|-
| <code><nowiki>{{Ordinal|104}}</nowiki></code> || {{Ordinal|104}}
|-
| <code><nowiki>{{Ordinal|1|lang=en}}</nowiki></code> || {{Ordinal|1|lang=en|}}
|-
| <code><nowiki>{{Ordinal|1|lang=en|style=d}}</nowiki></code> || {{Ordinal|1|lang=en|style=d}}
|-
| <code><nowiki>{{Ordinal|3|lang=pl}}</nowiki></code> || {{Ordinal|3|lang=pl}}
|-
| <code><nowiki>{{Ordinal|21|lang=fr}}</nowiki></code> || {{Ordinal|21|lang=fr}}
|-
| <code><nowiki>{{Ordinal|21|lang=fr|style=roman}}</nowiki></code> || {{Ordinal|21|lang=fr|style=roman}}
|-
| <code><nowiki>{{Ordinal|1|lang=de}}</nowiki></code> || {{Ordinal|1|lang=de}}
|-
| <code><nowiki>{{Ordinal|87|lang=es|gender=f}}</nowiki></code> || {{Ordinal|87|lang=es|gender=f}}
|-
| <code><nowiki>{{Ordinal|87|lang=es|gender=f|nosup=y}}</nowiki></code> || {{Ordinal|87|lang=es|gender=f|nosup=y}}
|}
<includeonly>
<includeonly>
[[Category:Mathematical function templates|{{PAGENAME}}]]
[[Category:Mathematical function templates|{{PAGENAME}}]]
 
[[Category:Number formatting templates]]
[[ia:Patrono:Ordinal]]
[[ro:Format:Ordinal]]
</includeonly>
</includeonly>

Latest revision as of 06:44, 27 January 2020

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

ParameterDescriptionDefaultStatus
1positive integer numberemptyoptional
stylePresentation 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) .
{{Ordinal|101|lang=en|style=d}}, for example, produces 101d.
  • In French you can use "style=roman" to display the number (in 1–5,000,000 range) as roman numeral.
{{Ordinal|21|lang=fr}}, for example, produces 21e while {{Ordinal|21|lang=fr|style=roman}} produces XXIe.
  • In French you can use "style=roman-title" to display the number as a roman numeral with no suffix except for 1st.
For example, {{Ordinal|1|lang=fr|style=roman-title}} produces Ie but {{Ordinal|3|lang=fr|style=roman-title}} produces III.
  • In French you can use "style=pair" to display ordinals for numbers in a pair.
For example, {{Ordinal|1|lang=fr|gender=m|style=pair}} produces 1er but {{Ordinal|2|lang=fr|gender=m|style=pair}} produces 2nd.
  • In Tamil you can use "style=trad" to display traditional Tamil ordinals rather than modern Tamil ordinals.
{{Ordinal|1|lang=ta}}, for example, produces 1‑ஆம் while {{Ordinal|1|lang=ta|style=trad}} produces மு௧லாம்.
{{Ordinal|23|lang=ta}}, for example, produces 23‑ஆம் while {{Ordinal|23|lang=ta|style=trad}} produces ௨௩ஆம்.
emptyoptional
genderGender affects ordinal indicators in several languages, including French and Polish. Genders: m for male, f for female and n for neuter.emptyoptional
langlanguage code of the language in which to display the ordinal number, e.g. en for English, de for German, etc.{{int:Lang}}optional
nosupSet nosup=y to display the ordinals without superscript for links and category names. E.g. 101st instead of 101st.emptyoptional
debugemptyoptional

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

Relies on:
Module:Ordinal

See also

Examples

Code Result
{{Ordinal|101}} 101st
{{Ordinal|102}} 102nd
{{Ordinal|103}} 103rd
{{Ordinal|104}} 104th
{{Ordinal|1|lang=en}} 1st
{{Ordinal|1|lang=en|style=d}} 1d
{{Ordinal|3|lang=pl}} 3‑ci
{{Ordinal|21|lang=fr}} 21e
{{Ordinal|21|lang=fr|style=roman}} XXIe
{{Ordinal|1|lang=de}} 1.
{{Ordinal|87|lang=es|gender=f}} 87.a
{{Ordinal|87|lang=es|gender=f|nosup=y}} 87a


Cookies help us deliver our services. By using our services, you agree to our use of cookies.