Class: RomanNumber

system.numeric. RomanNumber


new RomanNumber( [value])

The tool class to parse and transforme the Roman numerals.

Roman numerals are a numeral system originating in ancient Rome, adapted from Etruscan numerals.

Roman numerals are commonly used in numbered lists (in outline format), clock faces, pages preceding the main body of a book, chord triads in music analysis, the numbering of movie publication dates, successive political leaders or children with identical names, and the numbering of some annual sport events.

Links :

Parameters:
Name Type Argument Default Description
value number | string <optional>
0

The decimal uint value of the RomanNumber or a String representation of the roman numerals object.

Example
trace( RomanNumber.parse(12) ) ; // XII
trace( RomanNumber.parseRomanString('II') ) ; // 2

Members


<static, constant> MAX :number

The maximum parsing value (3999).

Type:
  • number

<static, constant> MIN :number

The minimum parsing value (0).

Type:
  • number

<static> NUMERIC :array

The array representation of all numeric values.

Type:
  • array

<static> ROMAN :array

The array representation of all roman expressions.

Type:
  • array

Methods


<static> parse(num)

Parse the specified value and return this roman numerals String representation.

Parameters:
Name Type Description
num number

The number value to convert in a roman numerals string representation.

Returns:

The roman numerals String representation of the specific number.

Type
string

<static> parseRomanString(roman)

Parses a roman String representation in this uint decimal representation.

Parameters:
Name Type Description
roman string

The roman string expression to parse and transform in a valid number.

Returns:

The uint decimal representation of the roman string expression.

Type
number

parse(value)

Parse the specified value.

Parameters:
Name Type Description
value number

The number to convert in a roman string expression.

Returns:

The string representation of the passed-in number.

Type
string

toString()

Returns the string representation of this instance.

Returns:

the string representation of this instance.


valueOf()

Returns the primitive value of this object.

Returns:

the primitive value of this object.