Template:Roman/doc

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Script error: No such module "Message box". Script error: No such module "High-use". Template:Lua Template: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 between 1 and 4999999.

Usage

{{Roman|number|message}}

Replace number with the number you would like to be converted to Roman numerals. For numbers higher than 4999999 the template outputs "N/A". This can be changed by replacing message with your preferred text.

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

See Roman numerals for further information.

Fraction support

The template can accept parsing decimals, fractions, and arithmetic expressions. This is not enabled by default. To enable this, supply |fraction=yes, i.e. {{Roman|105.5|fraction=yes}} or {{Roman|105.5|too big|fraction=yes}}.

Roman numeral output for fractional values uses these symbols:

  • S = Template:1/2
  • : = <templatestyles src="Fraction/styles.css" />16
  • • = <templatestyles src="Fraction/styles.css" />112
  • Є = <templatestyles src="Fraction/styles.css" />124
  • ƧƧ = <templatestyles src="Fraction/styles.css" />136
  • Ɔ = <templatestyles src="Fraction/styles.css" />148
  • Ƨ = <templatestyles src="Fraction/styles.css" />172
  • Ƨ = <templatestyles src="Fraction/styles.css" />1144
  • ℈ = <templatestyles src="Fraction/styles.css" />1288
  • » = <templatestyles src="Fraction/styles.css" />11728
  • N = 0

Examples

Arabic numerals Template call Roman numerals
0 Template:Tlx Script error: No such module "Roman".
1 Template:Tlx Script error: No such module "Roman".
2 Template:Tlx Script error: No such module "Roman".
49 Template:Tlx Script error: No such module "Roman".
50 Template:Tlx Script error: No such module "Roman".
51 Template:Tlx Script error: No such module "Roman".
1024 Template:Tlx Script error: No such module "Roman".
4999 Template:Tlx Script error: No such module "Roman".
5000 Template:Tlx Script error: No such module "Roman".
5001 Template:Tlx Script error: No such module "Roman".
69105 Template:Tlx Script error: No such module "Roman".
1048576 Template:Tlx Script error: No such module "Roman".
4999999 Template:Tlx Script error: No such module "Roman".
7654321 Template:Tlx Script error: No such module "Roman".
7654321 Template:Tlx Script error: No such module "Roman".

If the number provided is negative, the template will output an error message. If the first parameter provided cannot be interpreted as a number, the template will also output an error message. If no arguments are given, the template produces no output.

Decimal, fractional, and arithmetic examples

Value Template Call Roman Numerals
0.0005 Template:Tlx Script error: No such module "Roman".
20.002 Template:Tlx Script error: No such module "Roman".
110.003472 Template:Tlx Script error: No such module "Roman".
3+4.007 Template:Tlx Script error: No such module "Roman".
1-0.9861 Template:Tlx Script error: No such module "Roman".
4.6*2.5 Template:Tlx Script error: No such module "Roman".
1/3 Template:Tlx Script error: No such module "Roman".
9999/10000 Template:Tlx Script error: No such module "Roman".
100+5.5 Template:Tlx Script error: No such module "Roman".

TemplateData

Template:TemplateDataHeader

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
Message2

Message to display for numbers that are too big to be displayed in Roman numerals. (The largest number supported is 4999999.)

Default
N/A
Example
Too big
Stringoptional

See also

Template:Math templates


pt:Predefinição:Roman/doc </noinclyde>