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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-26 11:43 UTC]
round() returns float, which is printed using scientifica notation.
Expected behaviour.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 12 22:01:29 2024 UTC