ID: 44051 Updated by: [EMAIL PROTECTED] Reported By: andyhaslam at hotmail dot com -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: WHM/Apache/Linux PHP Version: 5.2.5 New Comment:
Hello, It works fine here (PHP 5.2.5, PHP 5.3-snap and PHP 6). Previous Comments: ------------------------------------------------------------------------ [2008-02-05 17:59:22] andyhaslam at hotmail dot com Description: ------------ An interesting bug, if you do the following: $val = 2345.35; $val = sprintf("%01.2f", $val); echo $val; Output is "2.00", instead of "2345.35". The solution is to use an intermediate variable: $val = 2345.35; $val2 = sprintf("%01.2f", $val); $val = $val2; echo $val; Reproduce code: --------------- $val = 2345.35; $val = sprintf("%01.2f", $val); echo $val; Expected result: ---------------- 2345.35 Actual result: -------------- 2.00 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44051&edit=1