Apply a discount before calculating tax
Example input
price: 100
discount: 20%
tax: 10%Expected result
savings: 20
subtotal: 80
tax: 8
total: 88Calculate using the three supplied values. The discount removes twenty from the starting price, then ten percent tax adds eight to the reduced subtotal. This example assumes a tax-exclusive starting price. A tax-inclusive displayed price needs a different interpretation rather than adding tax again.