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
 [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

Pull Requests

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: Sun Dec 01 18:01:29 2024 UTC