#20693 [Opn->Fbk]: round() doesn't always work
| From: | sniper@php.net | Date: | Thu, 28 Nov 2002 11:26:41 +0000 |
| Subject: | #20693 [Opn->Fbk]: round() doesn't always work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-26060@lists.php.net to get a copy of this message | ||
ID: 20693
Updated by: sniper@php.net
Reported By: bero@media.net.pl
-Status: Open
+Status: Feedback
Bug Type: *Math Functions
Operating System: Debian GNU/Linux (pool)
PHP Version: 4.2.3
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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