#35327 [Opn->Bgs]: inconsistent ROUND
| From: | johannes@php.net | Date: | Tue, 22 Nov 2005 10:58:33 +0000 |
| Subject: | #35327 [Opn->Bgs]: inconsistent ROUND | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-88677@lists.php.net to get a copy of this message | ||
ID: 35327
Updated by: johannes@php.net
Reported By: pb at tdcspace dot dk
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: w98
PHP Version: 4.4.1
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
round() returns a float value, use nnumber_fomat or
[s]printf to format it...
Previous Comments:
------------------------------------------------------------------------
[2005-11-22 11:55:03] pb at tdcspace dot dk
Description:
------------
This is not directly a dedicated bug - but i will report the behaviour
anyway.
The ROUND produce no decimals when whole numbers...
Syntax: ROUND(float, decimals)
so...
ROUND(1.345, 2) = "1.35" (OK)
but...
ROUND(1.000, 2) = "1" (we must to add ".00" to get "1.00")
This is somewhat annoying if You want to produce a list
with the same number of decimals - You must after a ROUND test on the
output and eventually add a "." and "0" 's.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35327&edit=1