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: Difference between revisions

Template page
m localised number formats (via a template, as the formatnum: Wiki extension is still outdated on Commons); add Korean, Japanese and Chinese, Thai, Khmer, Lao, Armenian; support localisable plurals in French an Spanish
bn
Line 2: Line 2:
   {{LangSwitch|{{#if:{{{lang|}}}|lang|}}={{{lang|}}}
   {{LangSwitch|{{#if:{{{lang|}}}|lang|}}={{{lang|}}}
   |default = {{formatnum|{{#expr:{{{1|}}}}}|{{#if:{{{lang|}}}|lang|}}={{{lang|}}}}}.<!-- includes at least: cs, de, fi, hu -->
   |default = {{formatnum|{{#expr:{{{1|}}}}}|{{#if:{{{lang|}}}|lang|}}={{{lang|}}}}}.<!-- includes at least: cs, de, fi, hu -->
  |bn = {{formatnum|{{#expr:{{{1|}}}}}|bn}}{{#ifeq:{{{nosup|}}}|y||<sup>}}{{#switch:{{#expr:abs({{{1|}}})mod 10}}
    |1|5|7|8|9|10=ম
    |2|3=য়
    |4=র্থ
    |6=ষ্ঠ
    |#default=শ
    }}{{#ifeq:{{{nosup|}}}|y||</sup>}}
   |br = {{formatnum|{{#expr:{{{1|}}}}}|eo}}-vet
   |br = {{formatnum|{{#expr:{{{1|}}}}}|eo}}-vet
   |en = {{formatnum|{{#expr:{{{1|}}}}}|en}}{{#ifeq:{{{nosup|}}}|y||<sup>}}{{#ifeq:{{{style|}}}|d
   |en = {{formatnum|{{#expr:{{{1|}}}}}|en}}{{#ifeq:{{{nosup|}}}|y||<sup>}}{{#ifeq:{{{style|}}}|d

Revision as of 16:35, 16 April 2014

Template documentation[ view · edit · history · purge ]
This documentation is transcluded from Template:Ordinal/doc.

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

{{Ordinal|101}}, for example, produces Template:Formatnumst.

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 Template:Formatnumd.
  • 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 Template:Formatnume while {{Ordinal|21|lang=fr|style=roman}} produces Template:Romane.
  • 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 Template:Formatnume but {{Ordinal|3|lang=fr|style=roman-title}} produces Template:Formatnume.
  • 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 Template:Formatnumer but {{Ordinal|2|lang=fr|gender=m|style=pair}} produces Template:Formatnume.
  • In Tamil you can use "style=trad" to display traditional Tamil ordinals rather than modern Tamil ordinals.
{{Ordinal|1|lang=ta}}, for example, produces Template:Formatnum. while {{Ordinal|1|lang=ta|style=trad}} produces Template:Formatnum..
{{Ordinal|23|lang=ta}}, for example, produces Template:Formatnum. while {{Ordinal|23|lang=ta|style=trad}} produces Template:Formatnum..
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. Template:Formatnumst instead of Template:Formatnumst.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}} Template:Formatnumst
{{Ordinal|102}} Template:Formatnumnd
{{Ordinal|103}} Template:Formatnumrd
{{Ordinal|104}} Template:Formatnumth
{{Ordinal|1|lang=en}} Template:Formatnumst
{{Ordinal|1|lang=en|style=d}} Template:Formatnumd
{{Ordinal|3|lang=pl}} Template:Formatnum-ci
{{Ordinal|21|lang=fr}} Template:Formatnume
{{Ordinal|21|lang=fr|style=roman}} Template:Romane
{{Ordinal|1|lang=de}} Template:Formatnum.
{{Ordinal|87|lang=es|gender=f}} Template:Formatnuma
{{Ordinal|87|lang=es|gender=f|nosup=y}} Template:Formatnuma
Cookies help us deliver our services. By using our services, you agree to our use of cookies.