Resources · 94
Commerce: verify currency amounts and rounding
Reconcile displayed prices, orders, payments and refunds without mixing units.
· 9 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. |
Acceptance case to reproduce
Fictional example: these inputs describe no customer or observed result.
View case inputs
{
"currency": "JPY",
"display_amount": 1000,
"stripe_amount": 1000,
"incorrect_times_100": 100000
}Expected decision
For JPY 1,000, the Stripe amount is 1000. Do not multiply every currency amount by 100.
Verification procedure
- Record currency and the provider’s expected unit.
- Test JPY and a two-decimal currency.
- Keep comparisons of stored, displayed and rounded amounts.
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.
API amount precision and exact units
A displayed value, a calculation amount and an API integer have different roles. This addition makes decimal scale, multiplier and required step explicit. The reader checks an exact representation before multiplying by quantity; it never silently rounds excess precision.
Adyen and Stripe documentation reviewed on 6 November 2026. Nine limited profiles explain unit contracts; this is neither a complete currency directory nor a list of available payment methods. Amounts and scenarios are fictional CIE examples.
Nine profiles: currency, operation and unit together
| Profile | Documentary scope | Representation decimals e | Multiplier 10ᵉ | Required integer step | Fictional example |
|---|---|---|---|---|---|
| Adyen · EUR | Minor-unit APIs, excluding Terminal API | 2 | 100 | 1 | 10.99 → 1099 |
| Adyen · JPY | Minor-unit APIs, excluding Terminal API | 0 | 1 | 1 | 500 → 500 |
| Adyen · KWD | Minor-unit APIs, excluding Terminal API | 3 | 1000 | 1 | 0.123 → 123 |
| Stripe · ISK | ISK amount representation; fractional ISK not permitted | 2 | 100 | 100 | 5 → 500; 5.25 rejected |
| Stripe · UGX | UGX charges; fractional UGX not permitted | 2 | 100 | 100 | 5 → 500; 5.25 refused |
| Stripe · HUF · charge | HUF charges | 2 | 100 | 1 | 10.45 → 1045 |
| Stripe · HUF · payout | Manual HUF payouts; whole currency amounts required | 2 | 100 | 100 | 10 → 1000; 10.45 refused |
| Stripe · TWD · charge | TWD charges | 2 | 100 | 1 | 800.45 → 80045 |
| Stripe · TWD · payout | Manual TWD payouts; whole currency amounts required | 2 | 100 | 100 | 800 → 80000; 800.45 refused |
The three Adyen profiles follow its decimal table for minor-unit APIs, excluding Terminal API. Stripe retains two-decimal representation for ISK and UGX while prohibiting fractions: the integer must be divisible by 100. For HUF and TWD, Stripe distinguishes two-decimal charges from manual payouts, which require an integer divisible by 100. Always select the operation profile; currency decimal count alone is insufficient. No exchange rate is described.
Adyen · Currency codes and minor units · Provider documentation · reviewed 2026-11-06
Stripe · Supported currencies and special cases · Provider documentation · reviewed 2026-11-06
Exact amount representation workshop
Select a profile, unit amount and quantity. Results show multiplier, step, unit integer, total integer and fixed decimal representations. Arithmetic uses exact integers; floating-point sums never determine the result. Extra decimal zeroes are accepted only when they do not change the value.
Workshop input profile: nonnegative amount with 1–12 digits before the point and 0–6 after it; ASCII point, no spaces, sign, grouping separator, exponent or redundant leading zeroes. Integer quantity 1–99 without leading zeroes. These educational bounds are not Adyen or Stripe limits.
No payment, API request, currency exchange, import, storage or export is performed. Exact representation establishes neither payment-method availability, minimum or maximum compliance, amount authorisation nor invoice compliance. This reader covers no tax, discount, negative refund, exchange, fee, settlement or applicable rounding rules.
Technical input uses an ASCII point, up to 12 integer and 6 fraction digits, without grouping or spaces. Quantity: 1–99. No implicit rounding.
Exact representation result
A reviewable conversion path
| Step | Check |
|---|---|
| 1 · Read the string | Separate integer and fraction without converting the value to floating point. Localised display strings require a separate explicit parser. |
| 2 · Apply scale e | Pad the fraction to e. Beyond e, accept zeroes only; any extra nonzero digit causes a precision rejection. |
| 3 · Check the step | The resulting integer must be divisible by the profile step. Correct scale can still represent a prohibited value, such as fractional ISK in the Stripe profile. |
| 4 · Multiply exactly | Integer total = unit integer × quantity. Reinsert the point e places from the end for technical representation; this is not a localised customer display. |
Three rounding experiments separate from exact conversion
These fictional CIE calculations explicitly choose nearest rounding with ties upward, on nonnegative values only, to two decimals. This is an exercise convention, not a rule attributed to either provider. In a two-decimal profile, the interactive reader rejects these fractions rather than applying this convention.
| Exact amount × quantity | Sum of rounded lines | Rounded exact total | Lines minus total |
|---|---|---|---|
| 0.335 × 3 | 0.34 × 3 = 1.02 | 1.005 → 1.01 | +0.01 |
| 0.005 × 2 | 0.01 × 2 = 0.02 | 0.010 → 0.01 | +0.01 |
| 0.3333 × 3 | 0.33 × 3 = 0.99 | 0.9999 → 1.00 | −0.01 |
A rounding difference shows a different operation order; it does not by itself identify the legally or commercially correct result. Define the rule before calculation and retain the reference total and any residual allocation.
Twelve explained scenarios, available without JavaScript
M01 · Two decimals, three units
| Profile / amount / quantity | Expected reading |
|---|---|
| adyen-eur / 10.99 / 3 | 1099 minor units per item; total 3297, or 32.97 EUR. |
M02 · JPY without multiplying by 100
| Profile / amount / quantity | Expected reading |
|---|---|
| adyen-jpy / 500 / 2 | 500 representation units per item; total 1000, or 1000 JPY. |
M03 · Three KWD decimals
| Profile / amount / quantity | Expected reading |
|---|---|
| adyen-kwd / 0.123 / 3 | 123 minor units per item; total 369, or 0.369 KWD. |
M04 · Unrepresentable JPY fraction
| Profile / amount / quantity | Expected reading |
|---|---|
| adyen-jpy / 10.5 / 1 | Precision rejection: 10.5 does not silently become 10 or 11. No integer amount is produced. |
M05 · No implicit rounding
| Profile / amount / quantity | Expected reading |
|---|---|
| adyen-eur / 10.995 / 1 | Precision rejection: this exact reader selects no rounding rule for the third decimal. |
M06 · ISK: scale and step differ
| Profile / amount / quantity | Expected reading |
|---|---|
| stripe-isk / 5 / 2 | 5 ISK is represented as 500; two units produce 1000, or 10.00 in the two-decimal technical representation. |
M07 · ISK: two decimals are insufficient
| Profile / amount / quantity | Expected reading |
|---|---|
| stripe-isk / 5.25 / 1 | Step rejection: this would represent fractional ISK. The contract requires an integer divisible by 100. |
M08 · Display comma rejected
| Profile / amount / quantity | Expected reading |
|---|---|
| adyen-eur / 10,99 / 1 | Technical input rejected. Only the ASCII decimal point is accepted; the reader does not infer a locale. |
M09 · Large integer preserved exactly
| Profile / amount / quantity | Expected reading |
|---|---|
| adyen-kwd / 999999999999.999 / 99 | Integer total 98999999999999901, or 98999999999999.901 KWD. Arithmetic demonstration: this exceeds JavaScript Number safe integer precision and establishes no permitted API limit. |
M10 · Exact zero, no eligibility inferred
| Profile / amount / quantity | Expected reading |
|---|---|
| adyen-eur / 0.000 / 1 | Arithmetic conversion 0, representation 0.00. This does not establish acceptance of a zero payment. |
M11 · Extra zeroes without loss
| Profile / amount / quantity | Expected reading |
|---|---|
| adyen-jpy / 10.000 / 3 | Extra decimals are all zero: exact conversion 10; total 30 JPY. |
M12 · Noncanonical quantity rejected
| Profile / amount / quantity | Expected reading |
|---|---|
| adyen-eur / 10.99 / 03 | The CIE input profile requires an ASCII integer from 1 to 99 without leading zeroes. This syntax rejection is not a provider payment rule. |
M13 · UGX: representation multiplied by 100
| Profile / amount / quantity | Expected reading |
|---|---|
| stripe-ugx / 5 / 1 | 5 UGX is represented by 500, with a step of 100. |
M14 · Fractional UGX refused
| Profile / amount / quantity | Expected reading |
|---|---|
| stripe-ugx / 5.25 / 1 | 525 fits the scale but is not divisible by 100; the fractional UGX amount is refused. |
M15 · HUF: two-decimal charge
| Profile / amount / quantity | Expected reading |
|---|---|
| stripe-huf-charge / 10.45 / 1 | 10.45 HUF gives 1045 for a charge. |
M16 · Same HUF, different manual payout
| Profile / amount / quantity | Expected reading |
|---|---|
| stripe-huf-payout / 10.45 / 1 | 1045 is not divisible by 100; this value is refused for a manual payout. |
M17 · Whole-currency manual HUF payout
| Profile / amount / quantity | Expected reading |
|---|---|
| stripe-huf-payout / 10 / 1 | 10 HUF gives 1000, divisible by 100. |
M18 · TWD: two-decimal charge
| Profile / amount / quantity | Expected reading |
|---|---|
| stripe-twd-charge / 800.45 / 1 | 800.45 TWD gives 80045 for a charge. |
M19 · Same TWD, different manual payout
| Profile / amount / quantity | Expected reading |
|---|---|
| stripe-twd-payout / 800.45 / 1 | 80045 is not divisible by 100; this value is refused for a manual payout. |
M20 · Whole-currency manual TWD payout
| Profile / amount / quantity | Expected reading |
|---|---|
| stripe-twd-payout / 800 / 1 | 800 TWD gives 80000, divisible by 100. |
Test the monetary contract end to end
| Suggested check | Useful record |
|---|---|
| Scope | Provider, API, operation, documentary version and currency. Do not extend a charge rule to every payout. |
| Reference value | Exact amount linked to currency code; separate calculation unit, technical integer and presentation. |
| Precision | Boundary cases, unrepresentable fractions, zeroes and integers beyond floating-point safe integer precision. |
| Rounding | Rule and application stage; compare line, total and allocation without changing conventions after observation. |
| Reconciliation | Values and identifiers across order, request, confirmation and refund; also check server-side. |
| Eligibility | Separately verify current account, payment-method and operation constraints before any real transaction. |
Investigate differences by retaining currency, unit and operation first. A correct symbol is insufficient: 500 may represent 500 JPY in one profile and 5 ISK in another. Exact representation and provider acceptance are complementary checks.
Sources and credits
Original CIE educational synthesis and calculations. Adyen and Stripe publish their respective documentation; no affiliation, certification or transaction guarantee is claimed. Fictional amounts are neither statistics nor client results. Recheck the current contract before a real integration.
Adyen · Currency codes and minor units · Provider documentation · reviewed 2026-11-06
SHA-256 : 558887aab2082ea9c937bdd1ec67eb27a3fd30098eda21107dea40a0d7f4beb0
Stripe · Supported currencies and special cases · Provider documentation · reviewed 2026-11-06
SHA-256 : e64bb9ab65e88a94c94fcc7bd8df1c1426d879e8020e7b2cc044b26bb6672929
Official references
References consulted: . The method and worksheet propose checks to adapt to your context; they do not constitute certification.
