<?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/16733" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16732" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16667" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16435" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15166" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15146" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12512" />

     </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/16733">
      <title>Numbers_Words: Bug 16733 [Assigned] Integral part treated incorrectly</title>
      <link>http://pear.php.net/bugs/16733</link>
      <content:encoded><![CDATA[<pre>Numbers_Words Bug
Reported by hubbitus
2009-10-23T13:25:54+00:00
PHP: 5.3.0 OS: Linux Package Version: 0.16.1

Description:
------------
Numbers_Words::toCurrency(44.555, 'en_US'): string(48) &quot;forty-four dollars five hundred fifty-five cents&quot;

It's incorrect - in this example &quot;five hundred fifty-five cents&quot; is $5.55 instead of 56cents!. Fractional part must be rounded to 2 digits before convert.

Fix is trivial, I'll do not include patch.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Numbers_Words Bug
Reported by hubbitus
2009-10-23T13:25:54+00:00
PHP: 5.3.0 OS: Linux Package Version: 0.16.1

Description:
------------
Numbers_Words::toCurrency(44.555, 'en_US'): string(48) &quot;forty-four dollars five hundred fifty-five cents&quot;

It's incorrect - in this example &quot;five hundred fifty-five cents&quot; is $5.55 instead of 56cents!. Fractional part must be rounded to 2 digits before convert.

Fix is trivial, I'll do not include patch.</pre>]]></description>
      <dc:date>2009-10-27T12:10:20+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 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-23T13: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-23T13: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-27T12: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/16667">
      <title>Numbers_Words: Feature/Change Request 16667 [Open] hungarian 40 is incorrect</title>
      <link>http://pear.php.net/bugs/16667</link>
      <content:encoded><![CDATA[<pre>Numbers_Words Feature/Change Request
Reported by vlajos
2009-10-01T12:42:20+00:00
PHP: 5.2.2 OS: Linux Package Version: 0.16.1

Description:
------------
The package says &quot;nÃ©gyven&quot;, but the correct is &quot;negyven&quot;. (without accent.)

I attached a fixed lang.hu_HU.php.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Numbers_Words Feature/Change Request
Reported by vlajos
2009-10-01T12:42:20+00:00
PHP: 5.2.2 OS: Linux Package Version: 0.16.1

Description:
------------
The package says &quot;nÃ©gyven&quot;, but the correct is &quot;negyven&quot;. (without accent.)

I attached a fixed lang.hu_HU.php.</pre>]]></description>
      <dc:date>2009-10-02T11:36:42+00:00</dc:date>
      <dc:creator>pear &amp;#x61;&amp;#116; lavela &amp;#x64;&amp;#111;&amp;#x74; hu</dc:creator>
      <dc:subject>Numbers_Words Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16435">
      <title>Numbers_Words: Bug 16435 [Analyzed] improper use of substr() in lang.pl.php</title>
      <link>http://pear.php.net/bugs/16435</link>
      <content:encoded><![CDATA[<pre>Numbers_Words Bug
Reported by santaslh
2009-07-14T00:05:03+00:00
PHP: 5.2.5 OS:  Package Version: 0.16.1

Description:
------------
in function _get_numlevel($num)
line
$num = (int)substr($num, -3);
doesn't return desired result when strlen($num) &lt; 3
see: http://php.net/manual/en/function.substr.php#75999

Test script:
---------------
print Numbers_Words::toCurrency(1,'pl','PLN');
print Numbers_Words::toCurrency(3,'pl','PLN');


Expected result:
----------------
jeden z&amp;#322;otych
trzy z&amp;#322;otych



Actual result:
--------------
jeden z&amp;#322;oty
trzy z&amp;#322;ote</pre>]]></content:encoded>
      <description><![CDATA[<pre>Numbers_Words Bug
Reported by santaslh
2009-07-14T00:05:03+00:00
PHP: 5.2.5 OS:  Package Version: 0.16.1

Description:
------------
in function _get_numlevel($num)
line
$num = (int)substr($num, -3);
doesn't return desired result when strlen($num) &lt; 3
see: http://php.net/manual/en/function.substr.php#75999

Test script:
---------------
print Numbers_Words::toCurrency(1,'pl','PLN');
print Numbers_Words::toCurrency(3,'pl','PLN');


Expected result:
----------------
jeden z&amp;#322;otych
trzy z&amp;#322;otych



Actual result:
--------------
jeden z&amp;#322;oty
trzy z&amp;#322;ote</pre>]]></description>
      <dc:date>2009-10-27T12:27:56+00:00</dc:date>
      <dc:creator>santaslh428660843 &amp;#x61;&amp;#116; spamherelots &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/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-26T08: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-26T08: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>2008-11-26T08:19:52+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-24T16: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-24T16: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-24T22: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>
    <item rdf:about="http://pear.php.net/bug/12512">
      <title>Numbers_Words: Bug 12512 [Verified] incorrect declaration of toWords() in lang.fr.php (and others!)</title>
      <link>http://pear.php.net/bugs/12512</link>
      <content:encoded><![CDATA[<pre>Numbers_Words Bug
Reported by ndeguine
2007-11-23T10:10:59+00:00
PHP: 5.2.4 OS: Windows Package Version: 0.15.0

Description:
------------
In lang.fr.php, the toWords method is defined as this :

function toWords($num = 0)

When I call this method, I have the following message :

Strict Standards: Declaration of Numbers_Words_fr::toWords() should be compatible with that of Numbers_Words::toWords() in C:\php\PEAR\Numbers\Words\lang.fr.php
 on line 438.

We should have this :

function toWords($num = 0, $power = 0, $powsuffix = '')

The previous line can solve this bug.

Test script:
---------------
echo $nw-&gt;toWords(100000,'fr') ;</pre>]]></content:encoded>
      <description><![CDATA[<pre>Numbers_Words Bug
Reported by ndeguine
2007-11-23T10:10:59+00:00
PHP: 5.2.4 OS: Windows Package Version: 0.15.0

Description:
------------
In lang.fr.php, the toWords method is defined as this :

function toWords($num = 0)

When I call this method, I have the following message :

Strict Standards: Declaration of Numbers_Words_fr::toWords() should be compatible with that of Numbers_Words::toWords() in C:\php\PEAR\Numbers\Words\lang.fr.php
 on line 438.

We should have this :

function toWords($num = 0, $power = 0, $powsuffix = '')

The previous line can solve this bug.

Test script:
---------------
echo $nw-&gt;toWords(100000,'fr') ;</pre>]]></description>
      <dc:date>2008-12-02T12:46:27+00:00</dc:date>
      <dc:creator>niconours1 &amp;#x61;&amp;#116; yahoo &amp;#x64;&amp;#111;&amp;#x74; fr</dc:creator>
      <dc:subject>Numbers_Words Bug</dc:subject>
    </item>
</rdf:RDF>
