#35442 [Opn->Bgs]: printf rounding error
| From: | tony2001@php.net | Date: | Mon, 28 Nov 2005 11:31:06 +0000 |
| Subject: | #35442 [Opn->Bgs]: printf rounding error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-89188@lists.php.net to get a copy of this message | ||
ID: 35442
Updated by: tony2001@php.net
Reported By: yag_kawa at yahoo dot co dot jp
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: Linux
PHP Version: 5.1.0
New Comment:
printf() doesn't *round* anything.
Use round() for that.
Previous Comments:
------------------------------------------------------------------------
[2005-11-28 12:26:20] yag_kawa at yahoo dot co dot jp
Description:
------------
printf %f rounding error
Reproduce code:
---------------
<?php
$a=43.65;
printf("%6.1f",$s);
?>
Expected result:
----------------
43.6
Actual result:
--------------
43.7
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35442&edit=1