<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=Numbers_Words</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/21226" />
      <rdf:li rdf:resource="http://pear.php.net/bug/20544" />
      <rdf:li rdf:resource="http://pear.php.net/bug/20495" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16732" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15166" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15146" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/21226">
      <title>Numbers_Words: Bug 21226 [Verified] es_AR</title>
      <link>http://pear.php.net/bugs/21226</link>
      <content:encoded><![CDATA[<pre>Numbers_Words Bug
Reported by harlyman
2017-07-06T12:42:20+00:00
PHP: 5.6.30 OS: Debian Package Version: 0.18.1

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-&gt;_sep . 'veinte';
                } else {
                    if ((($power &gt; 1) and ( $d == 1)) or ($powerDec 
and $d == 1)) {
                        $ret .= $this-&gt;_sep . 'veintiÃºn';
                    } else {
                        $ret .= $this-&gt;_sep . 'veinti' . $this-
&gt;_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 &gt; 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 &gt; 0) and ( $d == 1) or ($powerDec and 
$d == 1)) {
                    $ret .= $this-&gt;_sep . ' y un';
                } else {
                    $ret .= $this-&gt;_sep . 'y ' . $this-&gt;_digits[$d];
                }
            } else {
                if (($power &gt; 0) and ( $d == 1) or ($powerDec and 
$d == 1)) {
                    $ret .= $this-&gt;_sep . 'un';
                } else {
                    $ret .= $this-&gt;_sep . $this-&gt;_digits[$d];
                }
            }
        }

Test script:
---------------
$ntl = new NumerosLetras();
echo $ntl-&gt;toCurrency(41531321021.21, &quot;es_AR&quot;);

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</pre>]]></content:encoded>
      <description><![CDATA[<pre>Numbers_Words Bug
Reported by harlyman
2017-07-06T12:42:20+00:00
PHP: 5.6.30 OS: Debian Package Version: 0.18.1

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-&gt;_sep . 'veinte';
                } else {
                    if ((($power &gt; 1) and ( $d == 1)) or ($powerDec 
and $d == 1)) {
                        $ret .= $this-&gt;_sep . 'veintiÃºn';
                    } else {
                        $ret .= $this-&gt;_sep . 'veinti' . $this-
&gt;_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 &gt; 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 &gt; 0) and ( $d == 1) or ($powerDec and 
$d == 1)) {
                    $ret .= $this-&gt;_sep . ' y un';
                } else {
                    $ret .= $this-&gt;_sep . 'y ' . $this-&gt;_digits[$d];
                }
            } else {
                if (($power &gt; 0) and ( $d == 1) or ($powerDec and 
$d == 1)) {
                    $ret .= $this-&gt;_sep . 'un';
                } else {
                    $ret .= $this-&gt;_sep . $this-&gt;_digits[$d];
                }
            }
        }

Test script:
---------------
$ntl = new NumerosLetras();
echo $ntl-&gt;toCurrency(41531321021.21, &quot;es_AR&quot;);

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</pre>]]></description>
      <dc:date>2017-07-07T12:16:09+00:00</dc:date>
      <dc:creator>harlyman &amp;#x64;&amp;#111;&amp;#x74; facebook &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Numbers_Words Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/20544">
      <title>Numbers_Words: Bug 20544 [Open] Missing spaces in nl</title>
      <link>http://pear.php.net/bugs/20544</link>
      <content:encoded><![CDATA[<pre>Numbers_Words Bug
Reported by baud
2015-05-07T21:38:51+00:00
PHP: 5.5.9 OS: Ubuntu Package Version: 0.18.1

Description:
------------
If you use 55000 as an input, you get 'vijfenvijftigDuizend' in NL.
=&gt;A space is missing before 'Duizend'
If you use 55500 as an input, you get 'vijfenvijftigDuizendvijfhonderd'
=&gt;Two spaces are missing: before and after 'Duizend'

Test script:
---------------
$num=&quot;55000&quot;;
$numberToWord = new Numbers_Words();
$ret= $numberToWord-&gt;toWords($num,'nl');
echo $ret;

Expected result:
----------------
result should be: vijfenvijftig Duizend

Actual result:
--------------
result is: vijfenvijftigDuizend</pre>]]></content:encoded>
      <description><![CDATA[<pre>Numbers_Words Bug
Reported by baud
2015-05-07T21:38:51+00:00
PHP: 5.5.9 OS: Ubuntu Package Version: 0.18.1

Description:
------------
If you use 55000 as an input, you get 'vijfenvijftigDuizend' in NL.
=&gt;A space is missing before 'Duizend'
If you use 55500 as an input, you get 'vijfenvijftigDuizendvijfhonderd'
=&gt;Two spaces are missing: before and after 'Duizend'

Test script:
---------------
$num=&quot;55000&quot;;
$numberToWord = new Numbers_Words();
$ret= $numberToWord-&gt;toWords($num,'nl');
echo $ret;

Expected result:
----------------
result should be: vijfenvijftig Duizend

Actual result:
--------------
result is: vijfenvijftigDuizend</pre>]]></description>
      <dc:date>2015-05-07T22:45:20+00:00</dc:date>
      <dc:creator>baudouin &amp;#x64;&amp;#111;&amp;#x74; laloy &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Numbers_Words Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/20495">
      <title>Numbers_Words: Bug 20495 [Open] Long-scale naming vs Short-scale naming</title>
      <link>http://pear.php.net/bugs/20495</link>
      <content:encoded><![CDATA[<pre>Numbers_Words Bug
Reported by shehriyari
2015-01-29T22:32:52+00:00
PHP: Irrelevant OS: All Package Version: SVN

Description:
------------
@see http://en.wikipedia.org/wiki/Long_and_short_scales#English-speaking

As you can see from this source, there are two naming conventions for large numbers 
in West. Generally most continental Europe and Latin America use some weird 
method called &quot;long-scale&quot; where numbers' names in Short-scale (which is used by 
the rest of the world) are used **wrongly**. Now, thing is, when I viewed en_GB 
language version file of this package, I noticed such discrepancies in the naming of 
numbers. E.g.:

10^12 is called &quot;billion&quot; whereas in English -speaking world, 10^9 is billion.
10^12 is &quot;trillion&quot; and so on, so forth.

All seems OK in en_US version tho.

Please check the code against this topic and make relevant fixes. Because it is VERY 
confusing. 

Test script:
---------------
$this-&gt;assertEquals('two billion', $this-&gt;handle-&gt;toWords(2000000000, $this-&gt;lang));

Expected result:
----------------
two billion

Actual result:
--------------
thousand million</pre>]]></content:encoded>
      <description><![CDATA[<pre>Numbers_Words Bug
Reported by shehriyari
2015-01-29T22:32:52+00:00
PHP: Irrelevant OS: All Package Version: SVN

Description:
------------
@see http://en.wikipedia.org/wiki/Long_and_short_scales#English-speaking

As you can see from this source, there are two naming conventions for large numbers 
in West. Generally most continental Europe and Latin America use some weird 
method called &quot;long-scale&quot; where numbers' names in Short-scale (which is used by 
the rest of the world) are used **wrongly**. Now, thing is, when I viewed en_GB 
language version file of this package, I noticed such discrepancies in the naming of 
numbers. E.g.:

10^12 is called &quot;billion&quot; whereas in English -speaking world, 10^9 is billion.
10^12 is &quot;trillion&quot; and so on, so forth.

All seems OK in en_US version tho.

Please check the code against this topic and make relevant fixes. Because it is VERY 
confusing. 

Test script:
---------------
$this-&gt;assertEquals('two billion', $this-&gt;handle-&gt;toWords(2000000000, $this-&gt;lang));

Expected result:
----------------
two billion

Actual result:
--------------
thousand million</pre>]]></description>
      <dc:date>2015-01-29T22:32:52+00:00</dc:date>
      <dc:creator>shehi &amp;#x61;&amp;#116; imanov &amp;#x64;&amp;#111;&amp;#x74; name</dc:creator>
      <dc:subject>Numbers_Words Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16732">
      <title>Numbers_Words: Feature/Change Request 16732 [Assigned] Charsets/Locale should be handled</title>
      <link>http://pear.php.net/bugs/16732</link>
      <content:encoded><![CDATA[<pre>Numbers_Words Feature/Change Request
Reported by hubbitus
2009-10-23T18:05:57+00:00
PHP: 5.3.0 OS: Linux Package Version: 0.16.1

Description:
------------
Numbers_Words::toCurrency($price, setlocale(NULL), 'RUR'); should work properly. Or, in another way first example:
Numbers_Words::toCurrency($price, 'ru_RU.UTF-8', 'RUR');
provide all needed information in standardized way: Country, language, charset.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Numbers_Words Feature/Change Request
Reported by hubbitus
2009-10-23T18:05:57+00:00
PHP: 5.3.0 OS: Linux Package Version: 0.16.1

Description:
------------
Numbers_Words::toCurrency($price, setlocale(NULL), 'RUR'); should work properly. Or, in another way first example:
Numbers_Words::toCurrency($price, 'ru_RU.UTF-8', 'RUR');
provide all needed information in standardized way: Country, language, charset.</pre>]]></description>
      <dc:date>2009-10-27T16:26:39+00:00</dc:date>
      <dc:creator>pahan &amp;#x61;&amp;#116; hubbitus &amp;#x64;&amp;#111;&amp;#x74; spb &amp;#x64;&amp;#111;&amp;#x74; su</dc:creator>
      <dc:subject>Numbers_Words Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15166">
      <title>Numbers_Words: Feature/Change Request 15166 [Open] Think about generating an E_NOTICE if PHP_INT_SIZE is exceeded</title>
      <link>http://pear.php.net/bugs/15166</link>
      <content:encoded><![CDATA[<pre>Numbers_Words Feature/Change Request
Reported by doconnor
2008-11-26T13:19:52+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
If you pass in an argument to toWords(); and it's larger than PHP_INT_SIZE; it won't work as expected.

The easiest way to work around it is to cast it to a string.

This is surprising to junior developers, and we should generate a helpful notice or warning if we can.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Numbers_Words Feature/Change Request
Reported by doconnor
2008-11-26T13:19:52+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
If you pass in an argument to toWords(); and it's larger than PHP_INT_SIZE; it won't work as expected.

The easiest way to work around it is to cast it to a string.

This is surprising to junior developers, and we should generate a helpful notice or warning if we can.</pre>]]></description>
      <dc:date>2012-03-23T06:14:14+00:00</dc:date>
      <dc:creator>daniel &amp;#x64;&amp;#111;&amp;#x74; oconnor &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Numbers_Words Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15146">
      <title>Numbers_Words: Feature/Change Request 15146 [Open] DRY - refactor common, duplicated code</title>
      <link>http://pear.php.net/bugs/15146</link>
      <content:encoded><![CDATA[<pre>Numbers_Words Feature/Change Request
Reported by doconnor
2008-11-24T21:53:04+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
Many of the drivers have common code in toWords() - ie, they do it the same as english.

Consider implementing a utility class or refactoring into the parent class.

Example duplicate code:
      if (strlen($num) &gt; 3) {
          $maxp = strlen($num)-1;
          $curp = $maxp;
          for ($p = $maxp; $p &gt; 0; --$p) { // power
            
            // check for highest power
            if (isset($this-&gt;_exponent[$p])) {
              // send substr from $curp to $p
              $snum = substr($num, $maxp - $curp, $curp - $p + 1);
              $snum = preg_replace('/^0+/','',$snum);
              if ($snum !== '') {
                  $cursuffix = $this-&gt;_exponent[$power][count($this-&gt;_exponent[$power])-1];
                    if ($powsuffix != '') {
                        $cursuffix .= $this-&gt;_sep . $powsuffix;
                    }
                  $ret .= $this-&gt;toWords($snum, $p, $cursuffix);
              }
              $curp = $p - 1;
              continue;
            }
          }
          $num = substr($num, $maxp - $curp, $curp - $p + 1);
          if ($num == 0) {
              return $ret;
          }
      } elseif ($num == 0 || $num == '') {
        return $this-&gt;_sep . $this-&gt;_digits[0];
      }</pre>]]></content:encoded>
      <description><![CDATA[<pre>Numbers_Words Feature/Change Request
Reported by doconnor
2008-11-24T21:53:04+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
Many of the drivers have common code in toWords() - ie, they do it the same as english.

Consider implementing a utility class or refactoring into the parent class.

Example duplicate code:
      if (strlen($num) &gt; 3) {
          $maxp = strlen($num)-1;
          $curp = $maxp;
          for ($p = $maxp; $p &gt; 0; --$p) { // power
            
            // check for highest power
            if (isset($this-&gt;_exponent[$p])) {
              // send substr from $curp to $p
              $snum = substr($num, $maxp - $curp, $curp - $p + 1);
              $snum = preg_replace('/^0+/','',$snum);
              if ($snum !== '') {
                  $cursuffix = $this-&gt;_exponent[$power][count($this-&gt;_exponent[$power])-1];
                    if ($powsuffix != '') {
                        $cursuffix .= $this-&gt;_sep . $powsuffix;
                    }
                  $ret .= $this-&gt;toWords($snum, $p, $cursuffix);
              }
              $curp = $p - 1;
              continue;
            }
          }
          $num = substr($num, $maxp - $curp, $curp - $p + 1);
          if ($num == 0) {
              return $ret;
          }
      } elseif ($num == 0 || $num == '') {
        return $this-&gt;_sep . $this-&gt;_digits[0];
      }</pre>]]></description>
      <dc:date>2008-11-25T03:55:54+00:00</dc:date>
      <dc:creator>daniel &amp;#x64;&amp;#111;&amp;#x74; oconnor &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Numbers_Words Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
