NAME
Lingua::RU::Money::XS - Perl extension for digit conversion to corresponding money sum in Russian.
SYNOPSIS
use Lingua::RU::Money::XS qw(rur2words);
print rur2words(123456789012345.00)
# outputs "сто двадцать три триллиона четыреста пятьдесят шесть миллиардов семьсот восемьдесят девять миллионов двенадцать тысяч триста сорок пять рублей 00 копеек"
DESCRIPTION
SUBROUTINES
- Lingua::RU::Money::XS::rur2words
-
rur2words
returns a given as number money sum in words, i.e. 5.16 converts to пять рублей 16 копеек. The target charset is UTF-8.Caution: Current implementation of
rur2words
follows the Perl philosophy - anyway the given argument will be casted todouble
.Caution: Due to previous caution there are several constraints, making conversion impossible. These constraints divide input values into 4 groups listed below
- amount less than 0
-
Conversion for specified values make no sense. Thus,
rur2words
croaks for all these values. - amount between 0 and 1e12
-
Any value in this range converts correctly with the specified accuracy.
- amount between 1e12 and 1e15
-
Due to the lack for significant digits after the radix point for some values in this range, kopeck value is calculated inaccurate. It simply is replaced with the 0 with the corresponding warning.
- amount greater or equal than 1e15
-
Conversion for these values is impossible due to the type overflow.
rur2words
also croaks for all these values.
EXPORT
Nothing is exported by default.
SUPPORTED VERSIONS OF PERL
Please note that this module works only on Perl 5.16.0 and newer.
AUTHOR
Igor Munkin, <imun@cpan.org>
ACKNOWLEDGEMENTS
Mons Anderson - The original idea, rationale and motivation
BUGS
Feel free to report your bugs by mailing to <imun@cpan.org> or via https://github.com/igormunkin/Lingua-RU-Money-XS/issues
COPYRIGHT AND LICENSE
Copyright (C) 2017 by Igor Munkin
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.16.0 or, at your option, any later version of Perl 5 you may have available.