ID: 22887
User updated by: josh at chatgris dot com
Reported By: josh at chatgris dot com
Status: Open
Bug Type: Scripting Engine problem
Operating System: Gentoo Linux /w apache2
PHP Version: 4.3.1
New Comment:
I am not the only one experiencing this problem.. plus it
seems to round the number randomly for example
echo sprintf('%.2f', '8.7586206896551724');
returns 10.00
the person who had this problem's post is here
http://forums.gentoo.org/viewtopic.php?t=38470&highlight=sprintf
Previous Comments:
------------------------------------------------------------------------
[2003-03-27 21:55:28] [EMAIL PROTECTED]
It cannot be a general php problem as nobody here can reproduce it. It
has to something related to either Apache2 or some other factor unique
to your machine.
------------------------------------------------------------------------
[2003-03-27 21:44:51] josh at chatgris dot com
I built it with the lastest snapshot (phpinfo said it was
4.3.2-RC) and the exact same problem is occuring.
I have also made a sample C program to test the output of
printf and it works in the C program. So it's definately
something to do with php.
Anything else I can do to help you guys figure this out?
Josh.
------------------------------------------------------------------------
[2003-03-26 09:25:30] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Cannot verify using Apache 2 either, if latest snapshot still has this
problem, please include your configure line for PHP in your reply.
------------------------------------------------------------------------
[2003-03-26 00:28:12] [EMAIL PROTECTED]
Works just fine from in CLI and Apache1. Don't have an
Apache2 server handy for testing this.
------------------------------------------------------------------------
[2003-03-25 23:36:21] josh at chatgris dot com
Sample script
<?php
echo sprintf( "%.2f", 10.75 );
?>
returns 0.00
this is NOT the expected behaviour.
Using apache2, not tested on apache1.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22887&edit=1