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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -