FA-62289 / Currency rounding and FX conversion / Member archive
The customer is charged the requested amount instead of the dispensed amount · case 04
Requesting 200.00 but receiving 30,000 yen charges 200.00 plus the fee.
Case contract
solve(home_minor, rate, note, fee_minor): a request of home_minor home cents at rate foreign major units per home major unit is dispensed as the largest multiple of the smallest note not exceeding the converted amount (floor). If nothing can be dispensed return 'ERR:below-min-note'. The customer is charged the dispensed foreign amount converted back at the same rate, rounded UP to a home cent, plus fee_minor. Return [foreign_dispensed, charged_minor].
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 fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression charge-basis 1 | [67380000, 43399] | [67380000, 43394] | Failed |
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 ↗