Lingua::ENG::Numbers - Converts numeric values into their English string equivalents.
version 0.1106
## EXAMPLE 1 use Lingua::ENG::Numbers qw(American); $n = new Lingua::ENG::Numbers(313721.23); if (defined $n) { $s = $n->get_string; print "$s\n"; } ## EXAMPLE 2 use Lingua::ENG::Numbers; $n = new Lingua::ENG::Numbers; $n->parse(-1281); print "N = " . $n->get_string . "\n";
Perl 5, Exporter, Carp
Number 2 word conversion for ENG.
Lingua::ENG::Numbers converts arbitrary numbers into human-oriented English text. Limited support is included for parsing standardly formatted numbers (i.e. '3,213.23'). But no attempt has been made to handle any complex formats. Support for multiple variants of English are supported. Currently only "American" formatting is supported.
To use the class, an instance is generated. The instance is then loaded with a number. This can occur either during construction of the instance or later, via a call to the parse method. The number is then analyzed and parsed into the english text equivalent.
The instance, now initialized, can be converted into a string, via the get_string method. This method takes the parsed data and converts it from a data structure into a formatted string. Elements of the string's formatting can be tweaked between calls to the get_string function. While such changes are unlikely, this has been done simply to provide maximum flexability.
Creates, optionally initializes, and returns a new instance.
Parses a number and (re)initializes an instance. Only a number from interval [0, 10^66) can be converted.
Returns a formatted string based on the most recent parse.
The version of this class.
The current locale mode. Currently only American is supported.
The delimiter which seperates number groups. Example: "1,321,323" uses the comma ',' as the group delimiter.
The delimiter which seperates the main number from its decimal part. Example: "132.2" uses the period '.' as the decimal delimiter.
A character used at output time to convert the number into a string. Example: One Thousand, Two-Hundred and Twenty-Two point Four. Uses the space character ' ' as the block delimiter.
A character used at output time to convert the number into a string. Example: One Thousand, Two-Hundred and Twenty-Two point Four. Uses the comma ',' character as the group delimiter.
A character used at output time to convert the number into a string. Example: One Thousand, Two-Hundred and Twenty-Two point Four. Uses the dash '-' character as the number delimiter.
A character used at output time to convert the number into a string. Example: One Thousand, Two-Hundred and Twenty-Two point Four. Uses the 'point' string as the decimal delimiter.
A list of names for numbers.
A list of names for positive and negative signs.
A constant indicating the the current number is positive.
A constant indicating the the current number is negative.
(F) The module has been invoked with an invalid locale.
(F) The number specified is not in a valid numeric format.
(F) The decimal portion of number specified is not in a valid numeric format.
Stephen Pandich, pandich@yahoo.com
Maintenance PetaMem s.r.o. <info@petamem.com>
To install Lingua::ENG::Numbers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::ENG::Numbers
CPAN shell
perl -MCPAN -e shell install Lingua::ENG::Numbers
For more information on module installation, please visit the detailed CPAN module installation guide.