Class RomanNumeral

java.lang.Object
org.hipparchus.util.RomanNumeral

public final class RomanNumeral extends Object
Utility class to manage roman numerals.
Since:
4.1
  • Method Details

    • toRoman

      public static String toRoman(int n)
      Convert an integer to roman numeral.

      The classical subtractive form is generated here, i.e. 4 is represented as IV and not IIII.

      Parameters:
      n - number to convert
      Returns:
      string representation as a roman numeral
    • parse

      public static int parse(String r)
      Convert roman numeral to an integer.

      We accept here the additive form (IIII instead of IV).

      Parameters:
      r - roman numeral to convert
      Returns:
      value of the roman numeral