Edge Rewrite
Jump to content

Template:Sort Roman/doc

From Wikipedia, the free encyclopedia

Usage

[edit]

{{Sort Roman}} can be used in sortable tables to sort Roman numerals up to 38 correctly in numerical order. Without the template, IX, XIX, XXIX sort wrong. The template can be used on all Roman numerals up to 38 but only has to be used for IX, XIX, XXIX (9, 19, 29).

Change IX to {{Sort Roman|IX}}
Change XIX to {{Sort Roman|XIX}}
Change XXIX to {{Sort Roman|XXIX}}

The template also works with lowercase numerals like ix, xix, xxix.

There is no option to sort Roman numerals above 38 (more complicated and maybe never needed).

Arabic numerals (normal decimal digits) cannot be mixed with Roman numerals in a sortable column.

Demonstration

[edit]

The source text of this table uses {{Sort Roman}} in the whole third column and three cells of the fourth column.

Decimal number No sort template:
IX, XIX, XXIX sort wrong
{{Sort Roman|...}}
everywhere:
Sorts correctly
Only
{{Sort Roman|IX}}
{{Sort Roman|XIX}}
{{Sort Roman|XXIX}}:
Also sorts correctly
1III
2IIIIII
3IIIIIIIII
4IVIVIV
5VVV
6VIVIVI
7VIIVIIVII
8VIIIVIIIVIII
9IXIXIX
10XXX
11XIXIXI
12XIIXIIXII
13XIIIXIIIXIII
14XIVXIVXIV
15XVXVXV
16XVIXVIXVI
17XVIIXVIIXVII
18XVIIIXVIIIXVIII
19XIXXIXXIX
20XXXXXX
21XXIXXIXXI
22XXIIXXIIXXII
23XXIIIXXIIIXXIII
24XXIVXXIVXXIV
25XXVXXVXXV
26XXVIXXVIXXVI
27XXVIIXXVIIXXVII
28XXVIIIXXVIIIXXVIII
29XXIXXXIXXXIX
30XXXXXXXXX
31XXXIXXXIXXXI
32XXXIIXXXIIXXXII
33XXXIIIXXXIIIXXXIII
34XXXIVXXXIVXXXIV
35XXXVXXXVXXXV
36XXXVIXXXVIXXXVI
37XXXVIIXXXVIIXXXVII
38XXXVIIIXXXVIIIXXXVIII

Redirects

[edit]