NAME

Convert::Number::Roman - Convert Between Western and Roman Numeral Systems

SYNOPSIS

#
#  instantiate with a Western or Roman number (in UTF-8)
#
my $n = new Convert::Number::Roman( 4294967296 );
my $romanNumber = $n->convert;

$n->number ( 54321 );    # reset number handle
print $n->convert, "\n";
print $n->convert ( "lower" ), "\n";  # convert in lowercase numerals

print "2003 => ", $n->convert ( 2003 ), "\n";  # convert new number

DESCRIPTION

Implementation of the Roman numeral conversion algorithm proposed for the CSS3-List module specification. Use to convert between Western and Roman numeral systems under Unicode.

See: http://www.w3.org/TR/css3-lists/

Roman numerals have both uppercase and lowercase styles. The default style used is the uppercase. The default style can be set at instantiation time as per:

my $n = new Convert::Number::Roman( "lower" );

or

my $n = new Convert::Number::Roman( 4294967296, "lower" );

The default style may also be set during conversion as per:

$n->convert( "lower" );

or

$n->convert( 4294967296, "lower" );

The style method is also available to set or query the default style:

my $style = $n->style;  # query style

$n->style( "upper" );   # reset style

REQUIRES

The package is known to work on Perl 5.6.1 and 5.8.0 but has not been tested on other versions of Perl by the author.

COPYRIGHT

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

BUGS

None presently known.

AUTHOR

Daniel Yacob, dyacob@cpan.org

SEE ALSO

Math::Roman Text::Roman Roman

Convert::Number::Coptic Convert::Number::Ethiopic Convert::Number::Digits

Included with this package:

examples/numbers.pl   examples/roman.pl