NAME
Lingua::EO::Numbers - Convert numbers into Esperanto words
SYNOPSIS
use 5.010;
use Lingua::EO::Numbers qw( num2eo );
my $nombro = 99;
while ($nombro >= 0) {
say ucfirst num2eo( $nombro-- ), ' boteloj da biero sur la muro.';
}
output:
Naŭdek naŭ boteloj da biero sur la muro.
Naŭdek ok boteloj da biero sur la muro.
Naŭdek sep boteloj da biero sur la muro.
...
Nul boteloj da biero sur la muro.
DESCRIPTION
This module provides functions to convert numbers into words in Esperanto, a constructed international auxiliary language created by L. L. Zamenhof and published in 1887.
This module currently supports the standard Esperanto decimal separator (",") or the standard Perl one (".") and does not support any thousands separator. The option to set the supported decimal and thousands separators may be added in the future.
FUNCTIONS
The following functions are provided but are not exported by default.
- num2eo EXPR
-
If EXPR looks like a number, the text describing the number is returned. Both integers and real numbers are supported, including negatives. Special values such as "inf" and "NaN" are also supported.
- num2eo_ordinal EXPR
-
If EXPR looks like an integer, the text describing the number in ordinal form is returned. The behavior when passing a non-integer value is undefined.
The returned string is UTF-8 encoded. If EXPR is a value that does not look like a number or is not currently supported by this module, undef
is returned.
The :all
tag can be used to import all functions.
use Lingua::EO::Numbers qw( :all );
TODO
support one million and greater
support exponential notation
option for setting the input decimal separator
option for setting the input thousands separator
provide POD translation in Esperanto
SEE ALSO
Lingua::EO::Supersignoj, http://bertilow.com/pmeg/gramatiko/nombroj/
AUTHOR
Nick Patch, <n@atemoya.net>
The interface is based on Sean M. Burke's Lingua::EN::Numbers
COPYRIGHT AND LICENSE
Copyright 2009, 2010 Nick Patch
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.