calculate_margin
Gross margin AND markup for the same deal, plus reverse pricing from a target margin or markup and the real margin cost of a discount.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cost | Yes | Unit cost (what you paid) | |
| price | No | Selling price — omit if you are solving from a target | |
| marginPct | No | Target gross margin % — solve for price | |
| markupPct | No | Target markup % — solve for price | |
| discountPct | No | Discount to test against the resulting price |