Tutorials
Claude Opus 5.5: Check Discount Prices Before They Reach an Ad
Use Claude Opus 5.5 to reconcile the approved price source, discount formula and displayed offer.

Use Claude Opus 5.5 to reconcile the approved price source, discount formula and displayed offer. Give it the rounding policy instead of asking it to guess one. A price that looks correct after formatting can still disagree with checkout because the calculation rounded at a different stage.
Build one small price record
For each SKU, collect currency, original amount, approved discount, quantity, calculation order and the checkout result. Keep amounts as exact decimal values or integer minor units under an explicit currency policy. Do not assume every currency uses two decimal places. Tax, shipping and eligibility must come from the merchant's approved rules; this article's examples exclude them.
A developer question from June 2016 shows confusion between the amount saved and the final amount paid. It is a historical example of the question, not a production-ready pricing implementation.
| Question | Calculation or evidence | What to compare |
|---|---|---|
| What does the customer pay? | Original × remaining fraction | Checkout unit amount |
| How much is saved? | Original − final | Savings text |
| Are discounts sequential? | Multiply remaining fractions | Approved promotion order |
| Where is rounding performed? | Unit, line or order policy | Exact checkout behavior |
Calculate before formatting
In a hypothetical USD example, the original price is 19.99 and the discount is 15%. The unrounded final amount is 16.9915. With the example policy of rounding a positive amount to the nearest cent, ties upward, the final amount is 16.99 and the saving is 3.00. Do not calculate the final amount as merely 19.99 × 15%: that expression computes the discount amount before rounding.
Two successive discounts of 20% and 10% leave 0.8 × 0.9 = 0.72 of the original amount: a 28% reduction, not 30%. Eligibility and the order of fixed-amount coupons still need the merchant's actual rule; arithmetic does not authorize a new offer.
Rounding stage matters even with tiny values. Three units priced at 0.05 with 10% off give 0.045 per unit. Under this example's positive half-up policy, rounding each unit gives 0.05 × 3 = 0.15. Rounding the combined 0.135 gives 0.14. Neither policy should be silently substituted for the one used by checkout.
For nonnegative integer cents and an integer rate in basis points, this bounded example expresses that rounding rule explicitly:
const originalCents = 1999n;
const discountBasisPoints = 1500n;
const finalCents =
(originalCents * (10000n - discountBasisPoints) + 5000n) / 10000n;
This is illustrative arithmetic, not a complete pricing engine. Validate ranges, currency exponent and discount eligibility separately. MDN's Intl.NumberFormat reference describes display precision and rounding options. Formatting should present an already-approved amount; it should not become a second, hidden pricing policy.
Give Opus the reconciliation task
Audit the attached SKU price table against approved checkout examples. Inputs: currency and exponent, original amount, quantity, discounts, eligibility, tax/shipping scope and rounding policy. List missing rules instead of inventing them.
For each SKU show original, formula, unrounded result, rounding stage, final amount and savings. Distinguish sequential percentage discounts from adding percentages. Keep calculations exact with decimal arithmetic or integer minor units; do not parse localized display strings as numbers.
Compare the computed result with checkout and the proposed ad text. Flag mismatches without changing the source price or approving new claims. For our fictional USD examples use positive nearest-cent rounding with ties upward, and compare unit-level versus combined rounding.
Return a discrepancy table, reproducible calculations and corrected display suggestions for approval. State which computations actually ran. Do not claim an Opus test or checkout validation if no execution occurred.
This is a hypothetical Opus workflow, not a model benchmark. The official prompting guide can help frame the bounded task. The numerical examples here can be independently reproduced without relying on a generated explanation.
Questions at creative handoff
**Can formatting fix a one-cent mismatch?** It can hide extra digits, but not reconcile different calculation stages. Compare the preformatted approved amounts first.
**Can I copy a formatted number across languages?** Keep the currency and amount, then format for the destination locale. Never treat a comma or space as an arithmetic operator. Preserve SKU identity and check the actual rendered text.
**What about a countdown beside the price?** Check the promotion deadline separately; a correct price does not prove the offer is still active.
Once the price text is approved, use Panelly Studio to create a complete ad image with the intended offer and CTA. Compare the final image back to the approved price record. This does not imply an Opus integration or automatic checkout-price synchronization.


