Hi,
I'm trying to do the following calculations in a php form :
$_SESSION['total_main'] = $_SESSION['base_price'] * $_POST['Servings'];
$_SESSION['total_keiki'] = $_POST['Keiki_Servings'] * $_POST['Keiki_Price'];
$_SESSION['subtotal'] = $_SESSION['total_main'] + $_SESSION['total_keiki'];
$_SESSION['tax'] = round($_SESSION['subtotal'] * 0.04167, 2);
$_SESSION['total_due'] = $_SESSION['subtotal'] + $_SESSION['tax'];
The problem I'm having is this : If the base price is, say, $5.25 each, and the person orders two, then the Subtotal should be $10.50. However, the trailing zero is being dropped, and the Subtotal is presented as $10.5. I can't round or anything, because this has to be an exact price that's used to construct the final price. I round on the tax collection, rounding up.
Anybody know why the zero is being dropped?
Thanks!
Mark