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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 28 04:01:23 2020 UTC