The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Convert::Number::Greek - Convert between Arabic and Greek numerals

VERSION

This document describes version .01 of this module, hastily released on 16 August, 2006.

SYNOPSIS

  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;
  

DESCRIPTION

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, { OPTIONS } )

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

    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....

An object-oriented interface similar to that of Convert::Number::Roman will be implemented some day.

COMPATIBILITY

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.

BUGS

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.

AUTHOR

Father Chrysostomos <sprout @cpan.org>