percentages of over 1000
Posted: Wed Dec 01, 2004 1:52 am
For some strange reason if I try and get 10 % of my session variable $x when it is over 1000 I end up with the answer being 0.1 when it should be 100.
I have tried with amounts under 1000 like 975 and it returns 97.5 as it should but the minute i go over 1000 i get 0.1.
Stupid thing is that I can do it in a test script and everything seems fine.
Does anyone know what this could be? I have spent about 3 hours trying to figure this out and still no luck.
Brad
I have tried with amounts under 1000 like 975 and it returns 97.5 as it should but the minute i go over 1000 i get 0.1.
Stupid thing is that I can do it in a test script and everything seems fine.
Code: Select all
$x = 1650.00;
$y = 0.1;
$result = $x * $y;
echo "x*y = $result";Does anyone know what this could be? I have spent about 3 hours trying to figure this out and still no luck.
Brad