|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24342 Failure in float operations
Submitted: 2003-06-26 05:32 UTC Modified: 2003-06-26 10:51 UTC
From: hostmaster at bemarnet dot es Assigned:
Status: Not a bug Package: Math related
PHP Version: 4.3.2 OS: Gentoo Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: hostmaster at bemarnet dot es
New email:
PHP Version: OS:


 [2003-06-26 05:32 UTC] hostmaster at bemarnet dot es
Float operations (sprintf, number_format, etc..) fail.

Reproduce code:
  $num = 57.4523;    
  echo "1 : $num<br>";   
  echo "2 : ".sprintf("%2.02f", $num)."<br>";   
  echo "3 : ".number_format($num,2,'.',',');   

Expected result:
1 : 57.4523
2 : 57.45
3 : 57.45

Actual result:
1 : 57.4523
2 : i.00
3 : i00 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-26 06:28 UTC] hostmaster at bemarnet dot es
I have also tested with the latest revision (4.3.2-r2 dated 25 June)
 [2003-06-26 10:51 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Over optimization by gentoo can often result of corruption of floats. This is not a php bug.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 05:01:28 2024 UTC