Jump to content
Wikipedia The Free Encyclopedia

Template:Roman/doc

From Wikipedia, the free encyclopedia
This is a documentation subpage for Template:Roman.
It may contain usage information, categories and other content that is not part of the original template page.
Warning This template is used on approximately 3,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
This template uses Lua:
Related pages

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

[edit ]
{{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

[edit ]

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 = 12
  • : = 16
  • • = 112
  • Є = 124
  • ƧƧ = 136
  • Ɔ = 148
  • Ƨ = 172
  • (削除) Ƨ (削除ここまで) = 1144
  • ℈ = 1288
  • » = 11728
  • N = 0

Examples

[edit ]
Arabic numerals Template call Roman numerals
0 {{Roman|0}} N
1 {{Roman|1}} I
2 {{Roman|2}} II
49 {{Roman|49}} XLIX
50 {{Roman|50}} L
51 {{Roman|51}} LI
1024 {{Roman|1024}} MXXIV
4999 {{Roman|4999}} IVCMXCIX
5000 {{Roman|5000}} V
5001 {{Roman|5001}} VI
69105 {{Roman|69105}} LXIXCV
1048576 {{Roman|1048576}} MXLVMMMDLXXVI
4999999 {{Roman|4999999}} MMMMCMXCIXCMXCIX
7654321 {{Roman|7654321}} N/A
7654321 {{Roman|7654321|too high}} too high

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

[edit ]
Value Template Call Roman Numerals
0.0005 {{Roman|0.0005}} »
20.002 {{Roman|20.002}} XX»»»
110.003472 {{Roman|110.003472}} CX℈
3+4.007 {{Roman|3+4.007}} VII(削除) Ƨ (削除ここまで)
1-0.9861 {{Roman|1-0.9861}} Ƨ
4.6*2.5 {{Roman|4.6*2.5}} XIS
1/3 {{Roman|1/3}} ::
9999/10000 {{Roman|9999/10000}} S::ЄƧƧ(削除) Ƨ (削除ここまで)℈»»»»»
100+5.5 {{Roman|100+5.5}} CVS

TemplateData

[edit ]
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Roman in articles based on its TemplateData.

TemplateData for Roman

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

[edit ]
Math templates
  • Functions
  • Numeral systems
Functions
Numeral systems
Conversions
convert many units (see: list)
cvt abbreviated {{convert }}
convinfobox {{convert }} for infoboxes
bbl to t barrels of oil to tonnes
long ton long hundredweights, quarters and pounds to kilograms;
long tons and hundredweights to pounds and metric tons
miles-chains miles and chains to kilometres linking "chains"
decdeg degrees, minutes, and seconds to decimal degrees
deg2dms decimal degrees to degrees, minutes, and seconds
deg2hms decimal degrees to hour angle (in hours, minutes, and seconds)
hms2deg hour angle (in hours, minutes, and seconds) to decimal degrees
inflation calculate inflation of Consumer Price Index-related prices
pop density population density in an area
track gauge railway track gauges
Notation and formatting
bigmath bigger font to match TeX \displaystyle (standalone formulas only)
ceil, floor calculations :mw:Help:#expr; formatting indicators ⌈3.14⌉, 3.14 (no calculation performed)
fraction slant fractions 35 (not for maths/science articles; use standing or upright fractions {{sfrac}} instead)
  • ldelim
  • rdelim
  • multiline delimiters (2–5 lines inclusive)
    abs absolute values (paired vertical lines)
    math short text-based formulas
    mathcal [mathematical] calligraphic font; alternative to LaTeX \mathcal{...}
    mvar individual italicized maths variables in normal text
  • overline
  • underline
  • a line set above/below a sequence of characters
    overarc an arc set above a sequence of characters
  • overset
  • underset
  • arbitrary characters/diacritics set above/below one another
    pars parentheses that can be resized ()
    sfrac "standing" or upright fractions 3/5 (use in maths/science articles instead of{{fraction}})
  • sub
  • sup
  • su
  • subscripts and superscripts
    tmath Wrap TeX in <math> tags
    tombstone symbol indicating the end of a proof
    val measurement values, uncertainties and units
    vec various overarrows, underarrows, etc.
  • Boxes
  • Tags
  • Notices
  • </noinclyde>

    AltStyle によって変換されたページ (->オリジナル) /