This software replaces written English number descriptions with numerical representations.
The software application is quite comprehensive, supporting both ordinal and cardinal numbers, negative numbers, and very large numbers. To add to its convenience, the module exports a single function into the caller's namespace. The str2nbr function receives an optional string, using $_ if no string is passed, and proceeds to convert all English text that describes a number into its numeric equivalent.
When called in a void context, the function immediately sets $_ to the newly converted value. Furthermore, the Lingua::EN::Numericalize module's behavior is affected by two distinct variables. The first of which is $Lingua::EN::Numericalize::UK, which may be set to indicate the UK meaning of "billion" should be used. By default, the module uses the American meaning of this word.
It's essential to note that all the related larger numbers, such as trillion, quadrillion, etc., also assume the previously selected behavior. The second variable is $Lingua::EN::Numericalize::debug, which, if set to true, prompts the module to output on standard error messages useful for debugging.
To utilize Lingua::EN::Numericalize, one can use the following syntax:
```
use Lingua::EN::Numericalize;
print str2nbr("one thousand maniacs");
$_ = "six hundred three-score and six";
str2nbr();
print;
$Lingua::EN::Numericalize::UK = 1;
print str2nbr("one billion");
# 1,000,000,000,000.
```
Overall, Lingua::EN::Numericalize is a powerful software module that can save considerable time and effort for anyone who needs to convert English phrases into numerals. Its flexibility and ease of use make it a top choice for anyone seeking such functionality.
Version 1.52: N/A