Roman Numerals

Wordsmith provides several helpful methods for working with Roman numerals.

Roman numerals may include these symbols:

(Larger numbers, e.g. numbers form with apostrophi or vincula, are not supported.)

Wordsmith’s Roman numeral methods include:

Matching modes

You can choose how strict Wordsmith should be when trying to match Roman numeral notation.

In strict mode:

In loose mode, Wordsmith follows the rules of strict mode, with the following exceptions:

In loose-order mode, Wordsmith follows the rules of loose mode, with the following exception:

The default mode is strict.

Roman numeral casing

lowerCaseRoman

Lowercases any Roman numerals found in the string.

Parameters:

{{ 'MCMLIV. Chapter XI: NOT XICA!' | lowerCaseRoman }}

# "mcmliv. Chapter xi: NOT XICA!"
{{ 'IIXX, XIiX, III, MDcdIII, NOTXI, MMMM' | lowerCaseRoman(matchMode='loose-order') }}

# "iixx, xiix, iii, mdcdiii, NOTXI, mmmm"

upperCaseRoman

Uppercases any Roman numerals found in the string.

Parameters:

{{ 'foo vi bar' | upperCaseRoman }}

# "a VI b"
{{ 'mcmliv. Chapter xi: Not XiCa!' | upperCaseRoman }}

# "MCMLIV. Chapter XI: Not XiCa!"