from_roman

plasmapy.utils.roman.from_roman(s: str) → numbers.Integral

Convert a Roman numeral to an integer.

Parameters:

s (str) – A Roman numeral.

Returns:

result – The integer corresponding to the Roman numeral.

Return type:

int

Raises:
  • TypeError – The argument is not a str.
  • InvalidRomanNumeralError – The argument is not a valid Roman numeral.

See also

to_roman()

Examples

>>> from_roman('V')
5
>>> from_roman('MMMMCCCLXVII')
4367