FAILURE MAP
← Case archive

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

Digit groups are cut from the left · case 03

1234 dollars renders as '$123,4.00'.

Member previewVariant 3 · 3 implementations · 8 checks per implementation

Case contract

solve(minor, ccy): format integer minor units. Styles: USD '$' prefix, ',' groups, '.' decimal, 2 digits; EUR ' €' suffix, '.' groups, ',' decimal, 2; JPY '¥' prefix, ',' groups, 0 digits (no decimal separator); CHF 'CHF ' prefix, "'" groups, '.', 2; KWD 'KD ' prefix, ',', '.', 3. Group the whole part in threes from the right; the fraction is zero-padded to the exponent. A negative amount places '-' before everything. Unknown codes return 'ERR:currency'.

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 grouping-direction 1"-100.00,00 \u20ac""-10.000,00 \u20ac"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 ↗