Lingua::FR::Numbers

Converts numeric values into their French string equivalents
Download

Lingua::FR::Numbers Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Briac Pilpré
  • Publisher web site:
  • http://search.cpan.org/~briac/

Lingua::FR::Numbers Tags


Lingua::FR::Numbers Description

Converts numeric values into their French string equivalents Lingua::FR::Numbers is a Perl module to convert numeric values into their French string equivalents.SYNOPSIS # Procedural Style use Lingua::FR::Numbers qw(number_to_fr ordinate_to_fr); print number_to_fr( 345 ); my $vingt = ordinate_to_fr( 20 ); print "Tintin est reporter au petit $vingt"; # OO Style use Lingua::FR::Numbers; my $number = Lingua::FR::Numbers->new( 123 ); print $number->get_string; print $number->get_ordinate; my $other_number = Lingua::FR::Numbers->new; $other_number->parse( 7340 ); $french_string = $other_number->get_string;This module converts a number into a French cardinal or ordinal. It supports decimal numbers, but this feature is experimental.The interface tries to conform to the one defined in Lingua::EN::Number, though this module does not provide any parse() method. Also, unlike Lingua::En::Numbers, you can use this module in a procedural manner by importing the number_to_fr() function.If you plan to use this module with greater numbers (>10e20), you can use the Math::BigInt module: use Math::BigInt; use Lingua::FR::Numbers qw( number_to_fr ); my $big_num = new Math::BigInt '1.23e68'; print number_to_fr($big_num); # cent vingt-trois quintillions de sextillionsThis module should output strings for numbers up to, but not including, 1e75, but due to a lack of documentation in French grammar, it can only reliably output strings for numbers lower than 1e51. For example, 1e72 is 'un sextillion de sextillion', but I am unable to say 1e51 or 1e69, at least for now. Requirements: · Perl


Lingua::FR::Numbers Related Software