Jump to content

User:Stelio/Roman

From Wikipedia, the free encyclopedia

This is an improved version of the existing Template:Roman.

Written on 13 Mar 2009. Ideas implemented into practice on 25 Apr 2016.

This template converts numbers into Roman numerals, using the following symbols:

Symbol Value
M 1000
D 500
C 100
L 50
X 10
V 5
I 1
S ½
: 1/6
1/12
Є 1/24
ƧƧ 1/36
Ɔ 1/48
Ƨ 1/72
ƻ 1/144
1/288
» 1/1728
N 0

An overline, representing multiplication by 1000, is used to extend the upper range of the function.

See Roman numerals for further information.

Usage

[edit]
{{Roman | number | error_message }}

Where:

  • 'number' is a numeric value subject to the following limitations:
    • The largest number that this template will correctly process is 4,999,999 1727/1728 (which will be resolved as MMMMCMXCIXCMXCIXS::ЄƧƧƻ℈»»»»»). The template will return an error message if any argument is used that is larger than this.
    • A negative argument will result in the template returning an error message.
    • Arguments are rounded to the nearest 1728th, since this is the highest level of precision that this template includes.
  • 'error_message' is the text to display if the template cannot handle 'number' (i.e. 'number' is either too large or is negative). If left blank, the function will use descriptive error messages.

A blank argument will be treated as a zero value. A text argument will cause an 'Unrecognised word' error in the mathematical expression parser.

Template code

[edit]

N