Resources · 94
Commerce: verify currency amounts and rounding
Reconcile displayed prices, orders, payments and refunds without mixing units.
· 3 min
What this guide helps achieve
- Attach currency to amount
- Follow provider units
- Separate calculation and display
- Specify rounding policy
- Reconcile every output
Quick check
- Do all currencies use two decimals?
- Does Intl.NumberFormat calculate price?
- How should a leftover cent be assigned?
Step-by-step method
- 01
Attach currency to amount
Store value and currency code together. Distinguish presentment from settlement currency. Never sum euros and yen; conversion needs an explicit rate, date and rule.
Output: Amounts paired with currency.
- 02
Follow provider units
Stripe expects amounts in the unit defined for each currency. Check exceptions. Its examples use 1099 for 10.99 USD and 10 for 10 JPY. Do not universally multiply by 100.
Output: Unit contract per operation.
- 03
Separate calculation and display
Use exact decimal representation or integers suitable for the contract. Localised formatting does not establish the reference value. A displayed string with separators is not a reliable technical amount.
Output: Separate exact values and display.
- 04
Specify rounding policy
Document line or total rounding, discount allocation and residuals. Validate tax and document rules for the applicable context. Replay quantities, partial refunds and edge cases without silently switching policy.
Output: Rounding policy and edge cases.
- 05
Reconcile every output
Compare currency, units, totals and identifiers across basket, order, notification, invoice and refund. Check amounts server-side. A correctly formatted screen can conceal an incorrect payment request.
Output: Reconciliation across systems.
Fictional acceptance-test scenarios
These proposed cases are not client observations. Adapt data, permissions and acceptance criteria to your authorised environment.
| Situation to exercise | Result to check | Evidence to retain |
|---|---|---|
| Three lines each have a fictional pre-rounding amount of 0.335. | Define precision and the applicable rule before comparing rounded-line sums with a rounded total; do not select rules to obtain a preferred outcome. | Exact amounts, operation order and documented rule. |
| An API receives an amount in another currency. | Check currency, expected unit and provider exceptions; do not universally multiply by 100. | Payment contract and a payload without sensitive data. |
| Two partial refunds concern the same capture. | Reconcile confirmed amounts, currency and history to prevent over-refund or duplication. | Stable identifiers, states and confirmed refunded total. |
Reusable worksheet
Complete with your authorised observations. These fields are a working template, not observed results.
| Field | Information to record |
|---|---|
| Amount | Exact value, currency and unit |
| Calculation | Quantities, discounts, tax and rounding |
| Payment | Contract, submitted and received amounts |
| Acceptance | Differences, edge cases and refunds |
Worked example
Illustrative situation
Fictional EUR example: splitting €10.00 into three €3.33 lines leaves one cent unallocated.
Decision and expected evidence
The selected rule assigns that cent to a defined line and preserves a €10.00 total. This is not a universal tax rule.
Distinguish the mechanisms
| Mechanism | Purpose | Check or limitation |
|---|---|---|
| Calculation value | Perform an exact operation | Document precision and rounding |
| API amount | Follow provider contract | Currency-specific unit |
| Localised display | Present amount and symbol | Not an accounting calculation |
Management indicators
| Indicator | What it measures | First action |
|---|---|---|
| Total discrepancies | Differences between systems | Reconcile before confirmation |
| Currency cases | Supported currencies | Test each distinct contract |
| Residuals | Allocation differences | Apply documented policy |
Common pitfalls
- Document precision and rounding
- Currency-specific unit
- Not an accounting calculation
Frequently asked questions
Do all currencies use two decimals?
No. Check current provider contract and currency rules, including operation-specific exceptions.
Does Intl.NumberFormat calculate price?
It formats a value. Define calculation, taxes, discounts and rounding beforehand.
How should a leftover cent be assigned?
Use a validated, reproducible allocation rule. Retain the reference total and line breakdown.
Official references
References consulted: . The method and worksheet propose checks to adapt to your context; they do not constitute certification.






