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

NAME

Convert::Number::Armenian - convert between Armenian and Western numerals

SYNOPSIS

  use Convert::Number::Armenian qw( arm2int int2arm );
  
  my $armenian_rep = int2arm( 1999 );
  my $decimal_val  = arm2int( 'ՌՋՂԹ' );

DESCRIPTION

This is a relatively simple module for converting between Armenian-style numbers and their Western decimal representations. The module exports two functions on request: arm2int and int2arm.

FUNCTIONS

arm2int

Takes a string that contains an Armenian number and returns the decimal value. The function tries to deal with common though non-canonical representations such as ՃՌ for 100,000. The Armenian string may be upper- or lowercase, or a mix of both.

int2arm

Takes a number and returns its Armenian representation in canonical form, meaning an uppercase string with digit values descending from left to right. At the moment only values between 1 and 29999 can be converted.

TODO

The module as written depends on correct Perl Unicode behavior; that means that on earlier versions of Perl this module may not work as expected. As soon as I work out which is the minimum version, I will update the module with the correct requirement.

Armenian ligatures probably won't produce the correct result for arm2int.

LICENSE

This package is free software and is provided "as is" without express or implied warranty. You can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Tara L Andrews, aurum@cpan.org