PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Numbers » Numbers_Words » Bug #6654

russian locale - wrong toCurrency

Details

Submitted2006-02-01 12:37 UTC
Fromtrostin at gmail dot com
Assignedmakler
StatusClosed
PackageNumbers_Words
PHP Version4.3.11
OSlinux
Roadmaps(Not assigned)

Comments

[2006-02-01 12:37 UTC] trostin at gmail dot com

Description:
------------
$handle->toCurrency(405, "ru")
return "Четыреста пятнадцать рублей"
must "Четыреста пять рублей"

[2006-02-15 14:35 UTC] mot at tdvniikp dot ru

$num = new Numbers_Words();
$words = $num->toCurrency(1201.54);
return "Одна тысяча двести одиннадцать рублей пятьдесят четыре копейки."
must return "Одна тысяча двести один рубль пятьдесят четыре копейки."

[2006-03-14 19:01 UTC] mot at tdvniikp dot ru

Maintainer - this is very serious bug, we need your help please!

[2006-03-15 09:00 UTC] trostin at gmail dot com

to correct in file
Numbers\Words\lang.ru.php

$ones=(int)$num{2};
...
...
- elseif ($tens < 2) $ret .= $this->_teens[$ones+10];
+ elseif ( ($tens > 0) && ($tens < 2) ) $ret .= $this->_teens[$ones+10];
else {
- $ret .= $this->_tens[(int)$tens];
+ $ret .= @$this->_tens[(int)$tens];
if ($ones > 0) {
...
...

[2006-06-12 13:52 UTC] makler at php dot net

This bug has been fixed in CVS.

If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.