Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.18.2

Bug #21226 es_AR
Submitted: 2017-07-06 12:42 UTC
From: harlyman Assigned:
Status: Verified Package: Numbers_Words (version 0.18.1)
PHP Version: 5.6.30 OS: Debian
Roadmaps: (Not assigned)    
Subscription  


 [2017-07-06 12:42 UTC] harlyman (Carlos Andrade)
Description: ------------ mejoras en el manejo de valores terminados en uno en los decimales function _toWords($num, $power = 0, $powerDec = false) { ... case 2: if ($d == 0) { $ret .= $this->_sep . 'veinte'; } else { if ((($power > 1) and ( $d == 1)) or ($powerDec and $d == 1)) { $ret .= $this->_sep . 'veintiún'; } else { $ret .= $this->_sep . 'veinti' . $this- >_digits[$d]; } } break; ... // add digits only if it is a multiple of 10 and not 1x or 2x if (($t != 1) and ( $t != 2) and ( $d > 0)) { // don't add 'y' for numbers below 10 if ($t != 0) { // use 'un' instead of 'uno' when there is a suffix ('mil', 'millones', etc...) if (($power > 0) and ( $d == 1) or ($powerDec and $d == 1)) { $ret .= $this->_sep . ' y un'; } else { $ret .= $this->_sep . 'y ' . $this->_digits[$d]; } } else { if (($power > 0) and ( $d == 1) or ($powerDec and $d == 1)) { $ret .= $this->_sep . 'un'; } else { $ret .= $this->_sep . $this->_digits[$d]; } } } Test script: --------------- $ntl = new NumerosLetras(); echo $ntl->toCurrency(41531321021.21, "es_AR"); Expected result: ---------------- Pesos cuarenta y un mil quinientos treinta y un millones trescientos veintiún mil veintiuno con veintiún centavos Actual result: -------------- Pesos cuarenta y un mil quinientos treinta y un millones trescientos veintiún mil veintiuno con veintiuno centavos

Comments

 [2017-07-07 12:47 UTC] kouber (Kouber Saparev)
-Status: Open +Status: Verified
This issue should be fixed altogether with the introduction of genders, since sometimes you would expect also "veintiuna" I guess? That's an issue for all the languages that support noun genders (English is not such).