#23435 [Opn->Bgs]: number_format works badly

From: Date: Thu, 01 May 2003 09:56:07 +0000
Subject: #23435 [Opn->Bgs]: number_format works badly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38876@lists.php.net to get a copy of this message
ID: 23435 Updated by: derick@php.net Reported By: marcin at gasnace dot slonca dot net -Status: Open +Status: Bogus Bug Type: *Math Functions Operating System: Slackware Linux 8.1 kernel2.4.20 PHP Version: 4.3.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 This has to do with float rounding guidelines, not a bug in PHP. Previous Comments: ------------------------------------------------------------------------ [2003-05-01 04:37:36] marcin at gasnace dot slonca dot net i've got a script: <? echo number_format("4.705",2,'.',''); echo "<br>"; echo number_format("1.785",2,'.',''); ?> the result should be: 4.71 1.79 (because last digit is 5) but is 4.71 1.78 <-- why? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23435&edit=1

« previous php.bugs (#38876) next »