Library API
    Preparing search index...

    Function fromRoman

    • Converts a Roman numeral string into its numeric integer value.

      Parameters

      • roman: string

        Standard subtractive Roman numerals; matching is case-insensitive and surrounding whitespace is ignored

      Returns number

      The integer value (1-3999), or NaN if invalid

      fromRoman('MMXXVI'); // 2026
      fromRoman('XIV'); // 14
      fromRoman('IIII'); // NaN