php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41811 round() for large numbers ending with zeroes
Submitted: 2007-06-26 11:35 UTC Modified: 2007-06-26 11:43 UTC
From: psvob01 at seznam dot cz Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 5.2.3 OS: 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.
Password:
Status:
Package:
Bug Type:
Summary:
From: psvob01 at seznam dot cz
New email:
PHP Version: OS:

 

 [2007-06-26 11:35 UTC] psvob01 at seznam dot cz
Description:
------------
Description:
------------
when you round(2400000) or other large numbers ending with zeroes, php
automatically translates it with scientific notation, which is incorrect; the number should stay unchanged unless it exceeds precision parameter, set in php.ini. Rounding for large numbers ending with non-zero number, i.e. round(2400001) works OK.


Reproduce code:
---------------
<?
echo round(2400000);
?>

Expected result:
----------------
outputs "2400000"

Actual result:
--------------
outputs "2.4E+6"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-26 11:43 UTC] tony2001@php.net
round() returns float, which is printed using scientifica notation.
Expected behaviour.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC