#20693 [Fbk->Csd]: round() doesn't always work
| From: | bero at media dot net dot pl | Date: | Fri, 29 Nov 2002 01:13:59 +0000 |
| Subject: | #20693 [Fbk->Csd]: round() doesn't always work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-26125@lists.php.net to get a copy of this message | ||
ID: 20693
User updated by: bero@media.net.pl
Reported By: bero@media.net.pl
-Status: Feedback
+Status: Closed
Bug Type: *Math Functions
Operating System: Debian GNU/Linux (pool)
PHP Version: 4.2.3
New Comment:
upps,the real problem was setlocale()....
Previous Comments:
------------------------------------------------------------------------
[2002-11-28 05:26:41] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
------------------------------------------------------------------------
[2002-11-28 03:22:38] bero@media.net.pl
In a simple script consisting a single line like
<? round(195.583,2); ?>
round() produces a proper output. However in one of my scripts, where
round() is used inside a method of a sophisticated object, it gives the
folowig results:
echo round(195.583, 2); -> 195
echo round(195.583, 1); -> 195
echo round(195.583, 0); -> 195
echo round(195.583, -1); -> 200
echo round(195.583, -2); -> 200
I use PHP4.2.3 with Apache 1.3.26, both of them are original Debian's
binaries. I have reproduced this behaviour on several machines.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20693&edit=1