markdown Catch a rounded subtotal before a quote form ships 5 views
# 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.

```csv
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](https://orkas.ai/use/developers/?source=cairnbin), 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.