From:             oli_pla at hotmail dot com
Operating system: Windows 2000/XP
PHP version:      4.3.3
PHP Bug Type:     Strings related
Bug description:  printf produces incorrect result

Description:
------------
For some particular values, printf('%.2f',$val) gives incorrect results on
Windows 2000 and XP. The behaviour is that a digit is one unit too low.
For instance, with 813.54, you get 803.54, and 349.61 becomes 348.61.

On Windows 98 or Linux, the problem doesn't appear.

I'm aware it may be a bug in Microsoft's C runtime, in which case it
wouldn't be a PHP problem. But it would be interesting to be sure...

Reproduce code:
---------------
printf('%.2f',813.54);

Expected result:
----------------
813.54

Actual result:
--------------
803.54

-- 
Edit bug report at http://bugs.php.net/?id=25290&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25290&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25290&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25290&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25290&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25290&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25290&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25290&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25290&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25290&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25290&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25290&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25290&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25290&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25290&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25290&r=gnused

Reply via email to