메소드 | 설명 | |
---|---|---|
NumberToRoman ( int number, bool allowShorthand = true ) : string |
Converts an integer to it's roman number equivalent. When used after a conversion of RomanToNumber(string, bool, bool) this method should return the original roman that was presented.
|
|
RomanToNumber ( string roman, bool allowShorthand = true, bool throwExceptions = true ) : int |
Converts a roman number string to it's integer equivalent. When used after a conversion of NumberToRoman(int, bool) this method should return the original number that was presented.
|
public static NumberToRoman ( int number, bool allowShorthand = true ) : string | ||
number | int | The integer to convert. |
allowShorthand | bool | Optional: use shorthand/subtraction rules. Certain sequences of small value characters preceeding large value characters are allowed. |
리턴 | string |
public static RomanToNumber ( string roman, bool allowShorthand = true, bool throwExceptions = true ) : int | ||
roman | string | The roman number to convert to an integer. |
allowShorthand | bool | Optional: if true use shorthand/subtraction rules, certain sequences of small value characters preceeding large value characters are allowed. If false throws an exception (if specified) when a shorthand situation is encountered. |
throwExceptions | bool | Optional: if true throws exceptions as normal. If false does not throw exceptions and instead returns -1 immediately when an exception would be thrown. (Note: Setting false here is faster than wrapping the call in a Try-Catch block.) |
리턴 | int |