Liberator - 2 months ago 7x

SQL Question

I am trying to calculate the 19% of taxes from the total amount like this

`<?php echo number_format($show['total']*0.19,0,',',''); ?>`

The problem is, the product total price is 12990 so the real and correct taxes from this amount including the taxes is 2074 but with this code the result I get is 2468 and that is incorrect...

What is the correct formula to get the 19% taxes from the total amount including the taxes ( total to pay with taxes included )

Answer

Since you have value which is effectively 119%, you need

```
$show['total'] / 1.19 * 0.19
```

Source (Stackoverflow)

Comments