Hi Everyone, I have been trying to work out how to add 20% vat to a total in php, but for some reason I am unable to.
I have been using the following code, but I keep getting the same price for price_with_vat as I do for price_without_vat
// price without vat
$price_without_vat = round($kentPrice, 2);
// vat
$vat = 20.0; // define what % vat is
// price with vat
$price_with_vat = $price_without_vat + ($vat*($price_without_vat/100)); // work out the amount of vat
// round to 2 decimal places
$price_with_vat = round($kentPrice, 2);
Any help with be apprciated...