ID: 11435
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Bogus
Bug Type: Variables related
Operating system:
PHP Version: 4.0 Latest CVS (2001-06-12)
Assigned To:
Comments:
The famous rounding issue.
By using 'f' (float) would give you correct result.
Not a bug.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2001-06-12 09:23:30] [EMAIL PROTECTED]
<?php
$test="2.03";
$amount=($test*100);
echo $amount . "n";
printf("%06dn",$amount);
$amount=(2.03*100);
printf("%06dn",$amount);
?>
Produces the following output:
203
000202
000202
My math is a little fuzzy but I think 2.03 * 100 = 203. This
used to work in php 3.x but seems to be broken since the 4.x
beta.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11435&edit=2
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]