Lingua::RO::Numbers - Convert numeric values into their Romanian string equivalents and viceversa
Version 0.22
use Lingua::RO::Numbers qw(number_to_ro ro_to_number); print number_to_ro(315); # prints: 'trei sute cincisprezece' print ro_to_number('trei sute douazeci si cinci virgula doi'); # prints: 325.2
Lingua::RO::Numbers converts arbitrary numbers into human-readable Romanian text and viceversa, converting arbitrary Romanian text into its corresponding numerical value.
Nothing is exported by default. Only the functions number_to_ro() and ro_to_number() are exportable.
Initialize an object.
my $obj = Lingua::RO::Numbers->new();
is equivalent with:
my $obj = Lingua::RO::Numbers->new( diacritics => 1, invalid_number => undef, negative_sign => 'minus', decimal_point => 'virgulă', thousands_separator => '', infinity => 'infinit', not_a_number => 'NaN', );
Converts a number to its Romanian string representation.
# Functional oriented usage $string = number_to_ro($number); $string = number_to_ro($number, %opts); # Object oriented usage my $obj = Lingua::RO::Numbers->new(%opts); $string = $obj->number_to_ro($number); # Example: print number_to_ro(98_765, thousands_separator => q{,}); #=> 'nouăzeci și opt de mii, șapte sute șaizeci și cinci'
Converts a Romanian text into its numeric value.
# Functional oriented usage $number = ro_to_number($text); $number = ro_to_number($text, %opts); # Object oriented usage my $obj = Lingua::RO::Numbers->new(%opts); $number = $obj->ro_to_number($text); # Example: print ro_to_number('patruzeci si doi'); #=> 42
Daniel Șuteu, <trizen at protonmail.com>
<trizen at protonmail.com>
You can find documentation for this module with the perldoc command.
perldoc Lingua::RO::Numbers
https://github.com/trizen/Lingua-RO-Numbers
http://ro.wikipedia.org/wiki/Sistem_zecimal#Denumiri_ale_numerelor
Copyright 2013-2018 Daniel Șuteu.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
To install Lingua::RO::Numbers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::RO::Numbers
CPAN shell
perl -MCPAN -e shell install Lingua::RO::Numbers
For more information on module installation, please visit the detailed CPAN module installation guide.