FAILURE MAP
← Case archive

FA-61990 / Currency rounding and FX conversion / Member archive

Minor units are converted without rescaling between currency exponents · case 05

1000 US cents convert to 151370 yen instead of 1514 yen.

Member previewVariant 5 · 3 implementations · 6 checks per implementation

Case contract

solve(amount_minor, from_exp, to_exp, rate): amount_minor is an integer count of source minor units, rate a decimal string giving target major units per source major unit. The target minor amount is amount_minor * rate * 10**(to_exp - from_exp), computed exactly and rounded half-even to an integer.

Why this case matters

Currency amounts must be rounded at the right stage and in the right unit, or ledgers, quotes and settlements drift by minor units.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression exponent-rescale 1478566347856629066Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗