Hi,
My problem is just understandable, besides the simplicity of my script !!
I Have one html form page with 3 fields, the submit action points to a PHP file, wich make some simple mathematics calculations with the variables received from the html from page.
okey, for example, the name of the fields are: camp1, camp2, and camp3.
in the PHP file I make the following calculation:
$calculate=($camp1/$camp2)*camp3;
at this point everything is ok.
then. I try to round the result:
$rounded=round($calculate, 2);
and Guess what?
I received a 0 !!
I found that the division is causing this problem. If instead the division a put a sum sign :
$calculate=($camp1+$camp2)*camp3;
I get the result correctly !!!!
SO, what can I do ???
it's driven me crazy, why 0 ?? I don't get it.
Also, If I make the same calculation with variables created in the PHP script(not from the received variables), the problem doesn't come !!. So it seems that the the variables coming from the html form are causing some conflict . Again, only with the division.