Convert::Number::Coptic - Convert Between Western and Coptic Numeral Systems
# # instantiate with a Western or Coptic number (in UTF-8) # my $n = new Convert::Number::Coptic ( 12345 ); my $copNumber = $n->convert; $n->number ( 54321 ); # reset number handle print $n->convert, "\n"; print "2002 => ", $n->convert ( 2002 ), "\n"; # convert new number
Use to convert between Western and Coptic numeral systems.
Coptic numerals can be formatted in two ways. The standard convention is to use only underlines from 10^3 and onward. A lesser used convention accumulates only overlines. This package uses the standard convention.
Unicode does not define which diacritical symbols should be used for composing Coptic numerals. The solution here is to use U+0304 for single overline, U+0331 for single underline and U+0347 for double underline.
Since Unicode lacks diacritical symbols to build up numbers indefinitely (can't blame Unicode here) a complication arises for numbers of 1 billion or larger. Since there is no triple or quadruple, etc, underline non-spacing diacritical marks, this package simply appends extra diacritical symbols. For example:
10^5 => (U+03C1)(U+0331) 10^6 => (U+03B1)(U+0347) 10^7 => (U+03B9)(U+0347) 10^8 => (U+03C1)(U+0347) 10^9 => (U+03B1)(U+0347)(U+0331) 10^10 => (U+03B9)(U+0347)(U+0331) 10^11 => (U+03C1)(U+0347)(U+0331) 10^12 => (U+03B1)(U+0347)(U+0347) : : : : :
The shared Greek-Coptic range of Unicode is used by this package. This will be update when Unicode is revised to better support Coptic.
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.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
None presently known.
Daniel Yacob, dyacob@cpan.org
Convert::Number::Ethiopic Convert::Digits
Included with this package:
examples/numbers.pl
To install Convert::Number::Coptic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Convert::Number::Coptic
CPAN shell
perl -MCPAN -e shell install Convert::Number::Coptic
For more information on module installation, please visit the detailed CPAN module installation guide.