Template:Ordinal: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>FJM
No edit summary
 
m (18 revisions imported)
 
(17 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{{1|101}}}{{#ifeq: {{#expr: {{#expr: {{{1|101}}} mod 100 }} round -1}} | 10 | th
{{SAFESUBST:<noinclude />#invoke:Ordinal|ordinal}}<noinclude>
| {{#ifeq: {{#expr: {{{1|101}}} mod 10 }} | 1 | st
{{documentation}}
    | {{#ifeq: {{#expr: {{{1|101}}} mod 10 }} | 2 | nd
      | {{#ifeq: {{#expr: {{{1|101}}} mod 10 }} | 3 | rd
        | th
        }}
      }}
  }}
}}<noinclude>
 
This template will generate an appropriate ordinal suffix for a given number.
 
It could use stylesheet options for superscripted suffixes (i.e. ''101<sup>st</sup>'') and the ''-d'' suffixes used in the legal field (i.e. ''3d'' or ''22d'').
 
[[Category:Templates using ParserFunctions|{{PAGENAME}}]]
[[Category:Mathematical templates|{{PAGENAME}}]]
</noinclude>
</noinclude>

Latest revision as of 17:28, 3 September 2020

{{{1}}}st