|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-28 10:14 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 22:00:01 2025 UTC |
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