to_roman

plasmapy.utils.roman.to_roman(n: Union[numbers.Integral, numpy.integer]) → str

Convert an integer to a Roman numeral.

Parameters:

n (int or integer) – The integer to be converted to a Roman numeral that must be between 1 and 4999, inclusive.

Returns:

result – The number in Roman numeral notation.

Return type:

str

Raises:
  • TypeError – If the input is not an integer.
  • OutOfRangeError – If the number is not between 1 and 4999, inclusive.

See also

from_roman()

Examples

>>> to_roman(5)
'V'
>>> to_roman(2525)
'MMDXXV'