Discount / sale price calculator
calc_discountCalculates sale prices after stacked percent or fixed discounts with optional tax/VAT, finds the discount percentage between old and new prices, and compares two deals by price per unit.
Instructions
Three shop maths jobs. sale: price after one or two stacked discounts (each a percent or a fixed amount) plus optional tax/VAT, with what you save and the effective total discount (stacked percents multiply). reverse: the discount % between an old and a new price. compare: which of two deals is cheaper per unit (price and amount of each). Money is rounded to the cent at each step like a till. Web version: https://s3eidat.github.io/discount-calc/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| now | No | reverse: the new price. | |
| was | No | reverse: the old price. | |
| mode | No | Which calculator. | sale |
| unit | No | compare: the unit name (kg, L, item…). Default "unit". | |
| price | No | sale: original price. | |
| priceA | No | compare: price of deal A. | |
| priceB | No | compare: price of deal B. | |
| amountA | No | compare: amount of deal A (e.g. 0.5 for 500 g when unit is kg). | |
| amountB | No | compare: amount of deal B. | |
| discount | No | sale: first discount (percent by default). | |
| taxPercent | No | sale: optional tax / VAT percent added after the discounts. | |
| discountType | No | sale: first discount is a percent or a fixed amount. | percent |
| extraDiscount | No | sale: optional second discount applied after the first. | |
| extraDiscountType | No | sale: second discount type. | percent |