We have 2 types of amounts:
- DutyFree Amount.
- TaxIncluded Amount.
Conversion Formula is :
DutyFreeAmount * 1.21 = TaxIncluded Amount
TaxIncluded Amount / 1.21 = DutyFreeAmount
Original Amount (TaxIncluded Amount): 38497.79
We calculate DutyFree Amount : (divide it by 1.21 & roundOff to 2 decimal points)
38497.79 / 1.21 = 31816.3554 ~ 31816.36
Now we recalculated it to the original TaxIncluded amount
31816.36 * 1.21 = 38497.7956 ~38497.80
Delta: 38497.80 – 38497.79 = .01
How do we solve this problem? We have a functionality where users can switch the amount on the listing page of devices from DutyFree Amount to TaxIncluded Amount and vice-versa.
Due to this, we have to perform calculations on user action simultaneously.