Template:Roman Numeral/doc

< Template:Roman Numeral
Revision as of 19:14, 9 June 2022 by Procurator-Imperii-Romani (talk | contribs) (Created page with "{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> {{Lua|Module:Roman Numeral}} {{Lua sidebar}} This template converts Arabic numerals (that is, 1, 2, 3, etc.) into Roman numerals (I, II, III etc.). It currently works for any whole number though numbers may be increasingly hard to read the larger they get. == Usage == {{pre|<nowiki>{{Roman Numeral|</nowiki>''number''<nowiki>}}</nowiki>}} Replace <code>''number''</co...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This template converts Arabic numerals (that is, 1, 2, 3, etc.) into Roman numerals (I, II, III etc.). It currently works for any whole number though numbers may be increasingly hard to read the larger they get.

UsageEdit

{{Roman Numeral|number}}

Replace number with the number you would like to be converted to Roman numerals.

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

See Roman numerals for further information.

Fraction supportEdit

The template can accept parsing decimals, fractions, and arithmetic expressions. Though this may have varying results and is not incredibly accurate. It can currently do decimals in increments of 1/24ths.

Roman numeral output for fractional values uses these symbols:

  • S = ½
  • : = 1/6
  • • = 1/12
  • Σ = 1/24

ExamplesEdit

Arabic numerals Template call Roman numerals
0 {{Roman Numeral|0|explanation=yes}} N

0 is represented by N

-1 {{Roman Numeral|-1}} -I
1 {{Roman Numeral|1}} I
2 {{Roman Numeral|2}} II
49 {{Roman Numeral|49}} XLIX
50 {{Roman Numeral|50}} L
51 {{Roman Numeral|51}} LI
1024 {{Roman Numeral|1024}} MXXIV
4999 {{Roman Numeral|4999}} MↁCMXCIX
5000 {{Roman Numeral|5000}}
5001 {{Roman Numeral|5001}} ↁI
69105 {{Roman Numeral|69105}} ↇↂMↂCV
1048576 {{Roman Numeral|1048576}} MↂↇↁMMMDLXXVI
4999999 {{Roman Numeral|4999999}} MMↂↈMↂCMXCIX
7654321 {{Roman Numeral|7654321}} MMDↈↇMↁCCCXXI

As is apparent, if the number provided is negative the number will have negative polarity when outputted (represented by the minus sign prepended to the number). If the first parameter provided cannot be interpreted as a number, the template will output an error message. If no arguments are given, the template produces no output. If the first argument is a number but is below 1/24th then no output will be produced. Any number above 1/24th will produce an approximate result.

Examples:

  • {{Roman Numeral}}:
  • {{Roman Numeral|}}:
  • {{Roman Numeral|0.0005}}:

Decimal, fractional, and arithmetic examplesEdit

Value Template Call Roman Numerals
20.002 {{Roman Numeral|20.002}} XX
110.003472 {{Roman Numeral|110.003472}} CX
3+4.007 {{Roman Numeral|3+4.007}} VII
4.6*2.5 {{Roman Numeral|4.6*2.5}} XIS
1/3 {{Roman Numeral|1/3}}
9999/10000 {{Roman Numeral|9999/10000}} S⁙Σ
100+5.5 {{Roman Numeral|100+5.5}} CVS

TemplateDataEdit

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.

TemplateData for Roman Numeral

Convert numbers to Roman numerals.

Template parameters

ParameterDescriptionTypeStatus
Number1

The number to be converted to Roman numerals. If the parameter passed cannot be interpreted as a numerical value, no output is generated.

Example
69105
Numberoptional
Explanation2

Generate an explanation to what each part of the numeral represents.

Example
yes
Stringoptional

See alsoEdit