php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13537 number_format looses value integrity
Submitted: 2001-10-04 05:46 UTC Modified: 2001-10-04 05:53 UTC
From: assid at assid dot com Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 4.0.6 OS: linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: assid at assid dot com
New email:
PHP Version: OS:

 

 [2001-10-04 05:46 UTC] assid at assid dot com
try out this code

<?
$a=number_format(200000);
$b=number_format(-2000);
$c = $a + $b;
echo "$$a is $a <BR>
\$b is $b <BR>
\$c is $c";
?>

isnt it supposed $c supposed to be 198,000 ?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-04 05:53 UTC] derick@php.net
Not a bug
When the string "200,000" gets converted to a number when adding, it gets converted to 200 ("," is not a valid char in a number string)

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 17:01:29 2024 UTC