Skip to main content
Version: 2.11.10

Humanizer.RomanNumeralExtensions

RomanNumeralExtensions Class

Contains extension methods for changing a number to Roman representation (ToRoman) and from Roman representation back to the number (FromRoman)

public static class RomanNumeralExtensions

Inheritance System.Object → RomanNumeralExtensions

Methods

RomanNumeralExtensions.FromRoman(this string) Method

Converts Roman numbers into integer

public static int FromRoman(this string input);

Parameters

input System.String

Roman number

Returns

System.Int32
Human-readable number

RomanNumeralExtensions.ToRoman(this int) Method

Converts the input to Roman number

public static string ToRoman(this int input);

Parameters

input System.Int32

Integer input

Returns

System.String
Roman number

Exceptions

System.ArgumentOutOfRangeException
Thrown when the input is smaller than 1 or larger than 3999