Handle Roman Numerals
Convert between integers and Roman numerals (1-3999).
convertToRomanNumerals
Converts any valid integer from 1 to 3999 into its equivalent Roman numeral representation.
Function Signature
function convertToRomanNumerals(value: Numeric): RomanCapitalParameters
value(Numeric): The numeric input (eithernumberor numeric string) to be converted.
Return Value
RomanCapital: A string representing the uppercase Roman numeral form of the value.
Throws
RangeError: If the number is not an integer or is less than1or greater than3999.
Example Usage
playground.ts
Aliases
The following aliases can be used for the convertToRomanNumerals function:
toRomannumberToRomanarabicToRomanintegerToRomannumericToRomantoRomanNumeral
romanToInteger
Converts any valid Roman numeral from I to MMMCMXCIX (1–3999) into its equivalent Arabic integer representation.
Function Signature
function romanToInteger(roman: LooseRomanNumeral): numberParameters
roman(LooseRomanNumeral): The Roman numeral input (case-insensitive) to be converted.
Return Value
number: The integer form of the Roman numeral.
Throws
TypeError: If the input is not a non-empty string.Error: If the Roman numeral contains invalid characters or is malformed.RangeError: If the resulting number is less than1or greater than3999.
Example Usage
playground.ts
Aliases
The following aliases can be used for the romanToInteger function:
romanToArabicromanToNumericconvertRomanToArabicconvertRomanToNumericconvertRomanToInteger
Types
RomanCapital
type RomanCapital = string; // Uppercase Roman numeral representationLooseRomanNumeral
type LooseRomanNumeral = string; // String representing a Roman numeralLast updated: Sun, Jun 14, 2026 07:06:16AM (UTC)
