The total price inclusive of tax is 5 (which includes 10% tax) which means actual price is 4.55
and tax is 0.45
but if i do
10/100x4.55 it gives 0.46 (rounding to 2 points)
and total becomes
4.55+0.46=5.01 (actually should be 5.00)
so what can I do?
var tax_amount = ((parseFloat(actual_amount)*parseFloat(tax_percent))/parseFloat(100)).toFixed(2);
for 4.55 it produces 0.45555 which becomes 0.46 which should be 0.45 actually.
If i truncate it will be problem for another cacluations 0.4577 indeed should be 0.46