ID:               43053
 User updated by:  owner at dragon-hearts dot net
 Reported By:      owner at dragon-hearts dot net
 Status:           Verified
 Bug Type:         Scripting Engine problem
 Operating System: Centos4
 PHP Version:      5CVS-2007-10-25
 New Comment:

Any idea when this might get fixed, since php5.2.5 has been released
cpanel don't support 5.2.1 anymore hence it's not as easy to install
5.2.1 anymore and I'm stuck with 4.4.7 which won't be supported after
December causing even more problems.


Previous Comments:
------------------------------------------------------------------------

[2007-11-13 13:54:02] rbro at hotmail dot com

Yes, I haven't upgraded to the latest PHP 5.2.x for the same reasons as
it's causing similar issues for me with dollar amount calculations (e.g.
bug 42871).  This change seems to have started in recent 5.2.x releases,
but I don't recall it being on any changelog or announcement since it is
causing backwards-compatibility issues with earlier PHP releases.

------------------------------------------------------------------------

[2007-11-12 15:32:19] owner at dragon-hearts dot net

If it's because they're floats why doesn't it happen in earlier
versions of php i.e. 5.2.1? It makes migrating from php 5.2.1 to
anything higher a nightmare since any site using these numbers will no
longer work (i.e. mine didn't if you try and update mysql with what you
expect to be a non scientific number i.e 1000000 and it tries 1E+6 it'll
update it with 1 not 1000000) that causes real problems.

------------------------------------------------------------------------

[2007-11-12 10:19:01] [EMAIL PROTECTED]

The explanation is quite simple: the number are floats.
There is not guarantee that "1200000.00" is actually represented and/or
stored like that.
In this particular case, "1300000.00" is stored like "1299999.99", so
there are no zeros to compress.

------------------------------------------------------------------------

[2007-10-25 13:41:44] [EMAIL PROTECTED]

That last comment's script gives the same output for me, there's
definately something strange going on here. :)

------------------------------------------------------------------------

[2007-10-22 16:51:25] rbro at hotmail dot com

I am also running into this issue but only for certain float values. 
The original example posted works correctly for me, but other float
values are printed in scientific notation while others aren't.  It is
related to the issue I reported in bug 42871 which was marked bogus.  I
am running against php5.2-200710221430.

Reproduce code:
---------------
<?php
echo 1200000.00."\n";
echo 1300000.00."\n";
echo 1400000.00."\n";
echo 1500000.00."\n";

Expected result:
----------------
1200000
1300000
1400000
1500000

Actual result:
--------------
1.2E+6
1300000
1.4E+6
1500000

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/43053

-- 
Edit this bug report at http://bugs.php.net/?id=43053&edit=1

Reply via email to