Cairnbin

Catch a rounded subtotal before a quote form ships

markdown 4 views Created: November 20, 2026 at 16:06:11 EST

Catch a rounded subtotal before a quote form ships

A quote preview can look right while a half-cent line changes the total. Agree on the rounding rule before comparing a prototype and its implementation.

Try a small fixture

Use these invented order rows. Prices are in dollars. Use decimal arithmetic and round each line's extended amount to cents, half up, before adding the displayed subtotal.

sku,quantity,unit_price
SAMPLE-A,3,0.335
SAMPLE-B,1,0.335
SAMPLE-C,1,0.00

For SAMPLE-A, $1.005 rounds to $1.01. SAMPLE-B rounds to $0.34. The displayed subtotal must be $1.35, with SAMPLE-C still visible as a $0.00 line. Summing the unrounded amounts first would show $1.34 and violate this fixture's rule.

Give a reviewer the same inputs

In Orkas's product workflow workspace, bring the quote brief, fixture and existing form files together. Its local-first desktop AI team can help turn the approved interface state into a focused code change and an acceptance summary. The core is open source. Review the actual result before using it in customer-facing work.

Ask for: “Keep the existing quote fields. In the preview, add the displayed rounded line amounts to obtain the subtotal. Preserve visible zero-price lines. Return the changed file and the result for each fixture assertion.”

Illustrative acceptance record

  • SAMPLE-A shows 1.01.
  • SAMPLE-B shows 0.34.
  • SAMPLE-C remains visible as 0.00.
  • Subtotal shows 1.35.
  • Exported subtotal agrees with the preview.

Add a second fixture with prices already set to two decimal places if you need to verify the ordinary case as well.

Embed this paste

Install this app

  1. Tap the Share button
  2. Scroll down and tap "Add to Home Screen"
  3. Tap "Add" in the top right

Please confirm