Convert::Number::Greek - Convert between Arabic and Greek numerals
This document describes version .01 of this module, hastily released on 16 August, 2006.
use Convert::Number::Greek 'num2greek'; $greek_number = num2greek 1996; # $greek_number now contains a Unicode string. # OR use Convert::Number::Greek; $greek_number = Convert::Number::Greek::num2greek 1996;
This module provides one exportable subroutine, num2greek, which converts an Arabic numeral to a Greek numeral in the form of a Unicode string. The syntax is as follows:
num2greek
NUMBER is the number to convert. It should be a string of digits, nothing more (see BUGS, below). OPTIONS (optional) is a reference to a hash of boolean options. The options available are as follows:
Option Name Default Value Description upper 0 Use uppercase Greek letters uc 0 " " " " stigma 1 Use the stigma for 6 as opposed to sigma followed by tau arch_koppa 0 Use the archaic koppa instead of the modern one numbersign 1 Append a Greek number sign (U+0374) to the resulting string
When you specify options, undef is treated as false, so
undef
num2greek $some_number, { uc => 1, stigma }
actually means
num2greek $some_number, { uc => 1, stigma => 0 }
The greek2num function for parsing Greek numbers has yet to be written....
greek2num
An object-oriented interface similar to that of Convert::Number::Roman will be implemented some day.
Convert::Number::Roman
This module has only been tested in perl 5.8.6 on Darwin. It definitely will not work with perl versions earlier than 5.8.0.
The num2greek function does not yet have any error-checking mechanism in place. The input should be a string of Arabic digits, or at least a value that stringifies to such. Using an argument that does not fit this description may produce nonsensical results.
Father Chrysostomos <sprout @cpan.org>
To install Convert::Number::Greek, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Convert::Number::Greek
CPAN shell
perl -MCPAN -e shell install Convert::Number::Greek
For more information on module installation, please visit the detailed CPAN module installation guide.