Difference between revisions of "Template:Ordinal"

From Traveller Wiki - Science-Fiction Adventure in the Far future
Jump to navigation Jump to search
m (add category)
Line 1: Line 1:
{{{1|101}}}{{#ifeq: {{#expr: {{#expr: {{{1|101}}} mod 100 }} round -1}} | 10 | th
+
{{{1|101}}}<sup>{{#ifeq: {{#expr: {{#expr: {{{1|101}}} mod 100 }} round -1}} | 10 | th
 
  | {{#ifeq: {{#expr: {{{1|101}}} mod 10 }} | 1 | st
 
  | {{#ifeq: {{#expr: {{{1|101}}} mod 10 }} | 1 | st
 
     | {{#ifeq: {{#expr: {{{1|101}}} mod 10 }} | 2 | nd
 
     | {{#ifeq: {{#expr: {{{1|101}}} mod 10 }} | 2 | nd
Line 7: Line 7:
 
       }}
 
       }}
 
   }}
 
   }}
}}<noinclude>
+
}}</sup><noinclude>
  
 
This template will generate an appropriate ordinal suffix for a given number.
 
This template will generate an appropriate ordinal suffix for a given number.

Revision as of 14:31, 25 January 2015

101st

This template will generate an appropriate ordinal suffix for a given number.

It could use stylesheet options for superscripted suffixes (i.e. 101st) and the -d suffixes used in the legal field (i.e. 3d or 22d).