math - Rounding a VAT commission in PHP -
i want achieve following: putting commission vat on top rounding commission commission + vat have round number. in php.
lets have this:
50 euro original price 12 % + 4 euro comission = 10 euro 19 % vat on commission only(!) 61,19 total price
but want have
61 euro total price
how calculate it, commission decreases , both, commission , vat make round (no decimals) number?
$base = 50.00; $comission = $base * 0.12 + 4.00; $vat = $comission * 0.19; $total = $base + $comission + $vat;
thats got. hope can tell me clue!
cheers
Comments
Post a Comment