math calculation issue
Posted: Fri Jun 24, 2005 7:07 am
Code: Select all
$percent1 = $percent / 100;
$percent1 = $price * $percent1;and $price = 12
the above expressgives me result zero in $percent1
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$percent1 = $percent / 100;
$percent1 = $price * $percent1;Code: Select all
$price = 12;
$percent = 24.02;
$percent1 = $percent / 100;
$percent1 = $price * $percent1;
echo $percent1;2.8824
Is that a typo? $percent1 is what you are calculating and if that is defined instead of $percent that explains the problemitsmani1 wrote: when $percent1 = 24.02