need help with tax calculation displaying
tax cal code
$vat = 7.75;
$taxesOnly = ($val['quantity'] * $val['price'] / 100) * $vat;
result: $51.925
what i want: $51.92
thank you in advance
need help with tax calculation displaying
tax cal code
$vat = 7.75;
$taxesOnly = ($val['quantity'] * $val['price'] / 100) * $vat;
result: $51.925
what i want: $51.92
thank you in advance
2
Answers
you can use round($taksesOnly) like this code
this will return you two digit of decimal , or if you want to make changes accordingly based on currency & decimal separators.