cvs: pear /Numbers_Words/Words lang.bg.php lang.fr.php

From: Date: Mon, 26 Apr 2004 14:19:54 +0000
Subject: cvs: pear /Numbers_Words/Words lang.bg.php lang.fr.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-18750@lists.php.net to get a copy of this message
kouber Mon Apr 26 10:19:54 2004 EDT Modified files: /pear/Numbers_Words/Words lang.bg.php lang.fr.php Log: Small fix for negative numbers. http://cvs.php.net/diff.php/pear/Numbers_Words/Words/lang.bg.php?r1=1.1.1.1&r2=1.2&ty=u Index: pear/Numbers_Words/Words/lang.bg.php diff -u pear/Numbers_Words/Words/lang.bg.php:1.1.1.1 pear/Numbers_Words/Words/lang.bg.php:1.2 --- pear/Numbers_Words/Words/lang.bg.php:1.1.1.1 Wed Mar 10 05:33:10 2004 +++ pear/Numbers_Words/Words/lang.bg.php Mon Apr 26 10:19:54 2004 @@ -1,22 +1,22 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP version 4 | +// | PHP version 4                                                        | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 The PHP Group | +// | Copyright (c) 1997-2003 The PHP Group                                | // +----------------------------------------------------------------------+ -// | This source file is subject to version 3.0 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available through the world-wide-web at | -// | http://www.php.net/license/3_0.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | +// | This source file is subject to version 2.0 of the PHP license,       | +// | that is bundled with this package in the file LICENSE, and is        | +// | available through the world-wide-web at                              | +// | http://www.php.net/license/2_02.txt.                                 | +// | If you did not receive a copy of the PHP license and are unable to   | +// | obtain it through the world-wide-web, please send a note to          | +// | license@php.net so we can mail you a copy immediately.               | // +----------------------------------------------------------------------+ -// | Authors: Kouber Saparev <kouber@saparev.com> | +// | Authors: Kouber Saparev <kouber@saparev.com>               | // +----------------------------------------------------------------------+ // -// $Id: lang.bg.php,v 1.1.1.1 2004/03/10 10:33:10 makler Exp $ +// $Id: lang.bg.php,v 1.2 2004/04/26 14:19:54 kouber Exp $ /** * Include needed files @@ -440,19 +440,20 @@ function toWords($num = 0) { $ret = array(); + $ret_minus = ''; // check if $num is a valid non-zero number if (!$num || preg_match('/^-?0+$/', $num) || !preg_match('/^-?\d+$/', $num)) return $this->_zero; // add a minus sign if (substr($num, 0, 1) == '-') { - $ret[0] = $this->_minus . $this->_sep; + $ret_minus = $this->_minus . $this->_sep; $num = substr($num, 1); } // if the absolute value is greater than 9.99*10^302, return infinity if (strlen($num)>306) { - return $ret[0] . $this->_infinity; + return $ret_minus . $this->_infinity; } // strip excessive zero signs @@ -465,9 +466,6 @@ // go through the groups in reverse order, so that the last group could be determined for ($i=$sizeof_numgroups-1, $j=1; $i>=0; $i--, $j++) { - if (!isset($ret[$j])) { - $ret[$j] = ''; - } // what is the corresponding exponent for the current group $pow = $sizeof_numgroups-$i; @@ -497,8 +495,8 @@ } } - return rtrim(implode('', array_reverse($ret)), $this->_sep); + return $ret_minus.rtrim(implode('', array_reverse($ret)), $this->_sep); } // }}} } -?> +?> \ No newline at end of file http://cvs.php.net/diff.php/pear/Numbers_Words/Words/lang.fr.php?r1=1.1.1.1&r2=1.2&ty=u Index: pear/Numbers_Words/Words/lang.fr.php diff -u pear/Numbers_Words/Words/lang.fr.php:1.1.1.1 pear/Numbers_Words/Words/lang.fr.php:1.2 --- pear/Numbers_Words/Words/lang.fr.php:1.1.1.1 Wed Mar 10 05:33:11 2004 +++ pear/Numbers_Words/Words/lang.fr.php Mon Apr 26 10:19:54 2004 @@ -1,22 +1,22 @@ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP version 4 | +// | PHP version 4                                                        | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 The PHP Group | +// | Copyright (c) 1997-2003 The PHP Group                                | // +----------------------------------------------------------------------+ -// | This source file is subject to version 3.0 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available through the world-wide-web at | -// | http://www.php.net/license/3_0.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | +// | This source file is subject to version 2.0 of the PHP license,       | +// | that is bundled with this package in the file LICENSE, and is        | +// | available through the world-wide-web at                              | +// | http://www.php.net/license/2_02.txt.                                 | +// | If you did not receive a copy of the PHP license and are unable to   | +// | obtain it through the world-wide-web, please send a note to          | +// | license@php.net so we can mail you a copy immediately.               | // +----------------------------------------------------------------------+ -// | Authors: Kouber Saparev <kouber@saparev.com> | +// | Authors: Kouber Saparev <kouber@saparev.com>               | // +----------------------------------------------------------------------+ // -// $Id: lang.fr.php,v 1.1.1.1 2004/03/10 10:33:11 makler Exp $ +// $Id: lang.fr.php,v 1.2 2004/04/26 14:19:54 kouber Exp $ /** * Include needed files @@ -398,13 +398,13 @@ // add a minus sign if (substr($num, 0, 1) == '-') { - $ret[0] = $this->_minus . $this->_sep; + $ret = $this->_minus . $this->_sep; $num = substr($num, 1); } // if the absolute value is greater than 9.99*10^302, return infinity if (strlen($num)>306) { - return $ret[0] . $this->_infinity; + return $ret . $this->_infinity; } // strip excessive zero signs @@ -436,4 +436,4 @@ } // }}} } -?> +?> \ No newline at end of file

« previous php.pear.cvs (#18750) next »