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 )
Since you have value which is effectively 119%, you need
$show['total'] / 1.19 * 0.19
number_format($show['total']*1.19,0,',','');
Will give you the total.
number_format($show['total']*1.19 - $show['total'],0,',','');
Will give you the taxes only.
$taxesOnly = number_format($show['total'] / 1.19 * 0.19,0,',','');
Give you the amount of taxes already in total.