{"abstract":"Refunds render as '$-1.50' instead of '-$1.50'.","category":"Currency rounding and FX conversion","checks":8,"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'.","evaluation_group":"w2-currency_rounding_and_fx_conversion-currency-display-format","failed_approach":"Emitting the sign only for prefix styles drops it from suffix-style euro amounts.","family":"w2-currency_rounding_and_fx_conversion-currency-display-format-sign-placement","id":"FA-62141","implementations":{"attempt":{"sha256":"e6b8dcdce50d7480c9477744b4034126b58582d02f398ea12b53ba4754ba8ba8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(minor, ccy):\n    spec = {'USD': ('$', '', ',', '.', 2), 'EUR': ('', ' €', '.', ',', 2), 'JPY': ('¥', '', ',', '.', 0), 'CHF': ('CHF ', '', \"'\", '.', 2), 'KWD': ('KD ', '', ',', '.', 3)}\n    if ccy not in spec: return 'ERR:currency'\n    pre, suf, grp, dec, e = spec[ccy]\n    neg = minor < 0\n    major, frac = divmod(abs(minor), 10 ** e)\n    digits = str(major)\n    groups = []\n    while len(digits) > 3:\n        groups.insert(0, digits[-3:])\n        digits = digits[:-3]\n    groups.insert(0, digits)\n    body = grp.join(groups)\n    if e: body += dec + str(frac).zfill(e)\n    return ('-' if neg and pre else '') + pre + body + suf\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression sign-placement 1', (-150, 'USD'), '-$1.50'), ('regression sign-placement 2', (-1000, 'JPY'), '-¥1,000'),\n  ('partial repair guard 1', (-50, 'EUR'), '-0,50 €'), ('partial repair guard 2', (-1000000, 'EUR'), '-10.000,00 €'),\n  ('control: dollars', (123450, 'USD'), '$1,234.50'), ('control: yen', (1234567, 'JPY'), '¥1,234,567'),\n  ('control: franc', (12345678, 'CHF'), \"CHF 123'456.78\"), ('control: dinar', (1005, 'KWD'), 'KD 1.005')],\n [('regression sign-placement 1', (-100000, 'USD'), '-$1,000.00'),\n  ('regression sign-placement 2', (-50, 'KWD'), '-KD 0.050'),\n  ('partial repair guard 1', (-123456, 'EUR'), '-1.234,56 €'), ('partial repair guard 2', (-105, 'EUR'), '-1,05 €'),\n  ('control: yen', (1234567, 'JPY'), '¥1,234,567'), ('control: franc', (12345678, 'CHF'), \"CHF 123'456.78\"),\n  ('control: dinar', (1005, 'KWD'), 'KD 1.005'), ('control: unknown', (5, 'GBP'), 'ERR:currency')],\n [('regression sign-placement 1', (-105, 'KWD'), '-KD 0.105'), ('regression sign-placement 2', (-999, 'JPY'), '-¥999'),\n  ('partial repair guard 1', (-1000, 'EUR'), '-10,00 €'), ('partial repair guard 2', (-99999, 'EUR'), '-999,99 €'),\n  ('control: unknown', (5, 'GBP'), 'ERR:currency'), ('control: million euros', (100000000, 'EUR'), '1.000.000,00 €'),\n  ('control: zero yen', (0, 'JPY'), '¥0'), ('control: small dollars', (105, 'USD'), '$1.05')],\n [('regression sign-placement 1', (-105, 'JPY'), '-¥105'),\n  ('regression sign-placement 2', (-987654321, 'USD'), '-$9,876,543.21'),\n  ('partial repair guard 1', (-987654321, 'EUR'), '-9.876.543,21 €'),\n  ('partial repair guard 2', (-999, 'EUR'), '-9,99 €'), ('control: small dollars', (105, 'USD'), '$1.05'),\n  ('control: negative yen', (-1000, 'JPY'), '-¥1,000'), ('control: dollars', (123450, 'USD'), '$1,234.50'),\n  ('control: negative dollars', (-150, 'USD'), '-$1.50')],\n [('regression sign-placement 1', (-50, 'JPY'), '-¥50'),\n  ('regression sign-placement 2', (-1000000, 'CHF'), \"-CHF 10'000.00\"),\n  ('partial repair guard 1', (-100000, 'EUR'), '-1.000,00 €'), ('partial repair guard 2', (-5, 'EUR'), '-0,05 €'),\n  ('control: negative dollars', (-150, 'USD'), '-$1.50'), ('control: negative euro cents', (-50, 'EUR'), '-0,50 €'),\n  ('control: yen', (1234567, 'JPY'), '¥1,234,567'), ('control: franc', (12345678, 'CHF'), \"CHF 123'456.78\")]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"6d2e7e06788cf9a4555775bb589b9a9b3ab570331b5ba54e16012bac75632fef","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(minor, ccy):\n    spec = {'USD': ('$', '', ',', '.', 2), 'EUR': ('', ' €', '.', ',', 2), 'JPY': ('¥', '', ',', '.', 0), 'CHF': ('CHF ', '', \"'\", '.', 2), 'KWD': ('KD ', '', ',', '.', 3)}\n    if ccy not in spec: return 'ERR:currency'\n    pre, suf, grp, dec, e = spec[ccy]\n    neg = minor < 0\n    major, frac = divmod(abs(minor), 10 ** e)\n    digits = str(major)\n    groups = []\n    while len(digits) > 3:\n        groups.insert(0, digits[-3:])\n        digits = digits[:-3]\n    groups.insert(0, digits)\n    body = grp.join(groups)\n    if e: body += dec + str(frac).zfill(e)\n    return pre + ('-' if neg else '') + body + suf\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression sign-placement 1', (-150, 'USD'), '-$1.50'), ('regression sign-placement 2', (-1000, 'JPY'), '-¥1,000'),\n  ('partial repair guard 1', (-50, 'EUR'), '-0,50 €'), ('partial repair guard 2', (-1000000, 'EUR'), '-10.000,00 €'),\n  ('control: dollars', (123450, 'USD'), '$1,234.50'), ('control: yen', (1234567, 'JPY'), '¥1,234,567'),\n  ('control: franc', (12345678, 'CHF'), \"CHF 123'456.78\"), ('control: dinar', (1005, 'KWD'), 'KD 1.005')],\n [('regression sign-placement 1', (-100000, 'USD'), '-$1,000.00'),\n  ('regression sign-placement 2', (-50, 'KWD'), '-KD 0.050'),\n  ('partial repair guard 1', (-123456, 'EUR'), '-1.234,56 €'), ('partial repair guard 2', (-105, 'EUR'), '-1,05 €'),\n  ('control: yen', (1234567, 'JPY'), '¥1,234,567'), ('control: franc', (12345678, 'CHF'), \"CHF 123'456.78\"),\n  ('control: dinar', (1005, 'KWD'), 'KD 1.005'), ('control: unknown', (5, 'GBP'), 'ERR:currency')],\n [('regression sign-placement 1', (-105, 'KWD'), '-KD 0.105'), ('regression sign-placement 2', (-999, 'JPY'), '-¥999'),\n  ('partial repair guard 1', (-1000, 'EUR'), '-10,00 €'), ('partial repair guard 2', (-99999, 'EUR'), '-999,99 €'),\n  ('control: unknown', (5, 'GBP'), 'ERR:currency'), ('control: million euros', (100000000, 'EUR'), '1.000.000,00 €'),\n  ('control: zero yen', (0, 'JPY'), '¥0'), ('control: small dollars', (105, 'USD'), '$1.05')],\n [('regression sign-placement 1', (-105, 'JPY'), '-¥105'),\n  ('regression sign-placement 2', (-987654321, 'USD'), '-$9,876,543.21'),\n  ('partial repair guard 1', (-987654321, 'EUR'), '-9.876.543,21 €'),\n  ('partial repair guard 2', (-999, 'EUR'), '-9,99 €'), ('control: small dollars', (105, 'USD'), '$1.05'),\n  ('control: negative yen', (-1000, 'JPY'), '-¥1,000'), ('control: dollars', (123450, 'USD'), '$1,234.50'),\n  ('control: negative dollars', (-150, 'USD'), '-$1.50')],\n [('regression sign-placement 1', (-50, 'JPY'), '-¥50'),\n  ('regression sign-placement 2', (-1000000, 'CHF'), \"-CHF 10'000.00\"),\n  ('partial repair guard 1', (-100000, 'EUR'), '-1.000,00 €'), ('partial repair guard 2', (-5, 'EUR'), '-0,05 €'),\n  ('control: negative dollars', (-150, 'USD'), '-$1.50'), ('control: negative euro cents', (-50, 'EUR'), '-0,50 €'),\n  ('control: yen', (1234567, 'JPY'), '¥1,234,567'), ('control: franc', (12345678, 'CHF'), \"CHF 123'456.78\")]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"24d452b066414d4d056d4907009f694f4c3144e3443526447ca353d7481650b9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(minor, ccy):\n    spec = {'USD': ('$', '', ',', '.', 2), 'EUR': ('', ' €', '.', ',', 2), 'JPY': ('¥', '', ',', '.', 0), 'CHF': ('CHF ', '', \"'\", '.', 2), 'KWD': ('KD ', '', ',', '.', 3)}\n    if ccy not in spec: return 'ERR:currency'\n    pre, suf, grp, dec, e = spec[ccy]\n    neg = minor < 0\n    major, frac = divmod(abs(minor), 10 ** e)\n    digits = str(major)\n    groups = []\n    while len(digits) > 3:\n        groups.insert(0, digits[-3:])\n        digits = digits[:-3]\n    groups.insert(0, digits)\n    body = grp.join(groups)\n    if e: body += dec + str(frac).zfill(e)\n    return ('-' if neg else '') + pre + body + suf\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression sign-placement 1', (-150, 'USD'), '-$1.50'), ('regression sign-placement 2', (-1000, 'JPY'), '-¥1,000'),\n  ('partial repair guard 1', (-50, 'EUR'), '-0,50 €'), ('partial repair guard 2', (-1000000, 'EUR'), '-10.000,00 €'),\n  ('control: dollars', (123450, 'USD'), '$1,234.50'), ('control: yen', (1234567, 'JPY'), '¥1,234,567'),\n  ('control: franc', (12345678, 'CHF'), \"CHF 123'456.78\"), ('control: dinar', (1005, 'KWD'), 'KD 1.005')],\n [('regression sign-placement 1', (-100000, 'USD'), '-$1,000.00'),\n  ('regression sign-placement 2', (-50, 'KWD'), '-KD 0.050'),\n  ('partial repair guard 1', (-123456, 'EUR'), '-1.234,56 €'), ('partial repair guard 2', (-105, 'EUR'), '-1,05 €'),\n  ('control: yen', (1234567, 'JPY'), '¥1,234,567'), ('control: franc', (12345678, 'CHF'), \"CHF 123'456.78\"),\n  ('control: dinar', (1005, 'KWD'), 'KD 1.005'), ('control: unknown', (5, 'GBP'), 'ERR:currency')],\n [('regression sign-placement 1', (-105, 'KWD'), '-KD 0.105'), ('regression sign-placement 2', (-999, 'JPY'), '-¥999'),\n  ('partial repair guard 1', (-1000, 'EUR'), '-10,00 €'), ('partial repair guard 2', (-99999, 'EUR'), '-999,99 €'),\n  ('control: unknown', (5, 'GBP'), 'ERR:currency'), ('control: million euros', (100000000, 'EUR'), '1.000.000,00 €'),\n  ('control: zero yen', (0, 'JPY'), '¥0'), ('control: small dollars', (105, 'USD'), '$1.05')],\n [('regression sign-placement 1', (-105, 'JPY'), '-¥105'),\n  ('regression sign-placement 2', (-987654321, 'USD'), '-$9,876,543.21'),\n  ('partial repair guard 1', (-987654321, 'EUR'), '-9.876.543,21 €'),\n  ('partial repair guard 2', (-999, 'EUR'), '-9,99 €'), ('control: small dollars', (105, 'USD'), '$1.05'),\n  ('control: negative yen', (-1000, 'JPY'), '-¥1,000'), ('control: dollars', (123450, 'USD'), '$1,234.50'),\n  ('control: negative dollars', (-150, 'USD'), '-$1.50')],\n [('regression sign-placement 1', (-50, 'JPY'), '-¥50'),\n  ('regression sign-placement 2', (-1000000, 'CHF'), \"-CHF 10'000.00\"),\n  ('partial repair guard 1', (-100000, 'EUR'), '-1.000,00 €'), ('partial repair guard 2', (-5, 'EUR'), '-0,05 €'),\n  ('control: negative dollars', (-150, 'USD'), '-$1.50'), ('control: negative euro cents', (-50, 'EUR'), '-0,50 €'),\n  ('control: yen', (1234567, 'JPY'), '¥1,234,567'), ('control: franc', (12345678, 'CHF'), \"CHF 123'456.78\")]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic, bounded teaching model with a stipulated toy contract; it makes no claim of conformance to any real regulation, standard, or institution's rules. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-currency_rounding_and_fx_conversion-currency-display-format-sign-placement","generated_at":"2026-09-29T14:47:01.826966+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Currency amounts must be rounded at the right stage and in the right unit, or ledgers, quotes and settlements drift by minor units.","repair":"Emit the sign before the prefix.","root_cause":"The sign is concatenated after the prefix symbol.","sha256":"efe10d411d7e10d2590616b7bbdca77450bd416f889f720ddb16cb1f80e0449a","title":"The minus sign is placed between the currency symbol and the digits · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.761,"exit_code":1,"observations":[{"actual":"-$1.50","check":"regression sign-placement 1","expected":"-$1.50","passed":true},{"actual":"-¥1,000","check":"regression sign-placement 2","expected":"-¥1,000","passed":true},{"actual":"0,50 €","check":"partial repair guard 1","expected":"-0,50 €","passed":false},{"actual":"10.000,00 €","check":"partial repair guard 2","expected":"-10.000,00 €","passed":false},{"actual":"$1,234.50","check":"control: dollars","expected":"$1,234.50","passed":true},{"actual":"¥1,234,567","check":"control: yen","expected":"¥1,234,567","passed":true},{"actual":"CHF 123'456.78","check":"control: franc","expected":"CHF 123'456.78","passed":true},{"actual":"KD 1.005","check":"control: dinar","expected":"KD 1.005","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression sign-placement 1\", \"actual\": \"-$1.50\", \"expected\": \"-$1.50\", \"passed\": true}, {\"check\": \"regression sign-placement 2\", \"actual\": \"-¥1,000\", \"expected\": \"-¥1,000\", \"passed\": true}, {\"check\": \"partial repair guard 1\", \"actual\": \"0,50 €\", \"expected\": \"-0,50 €\", \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": \"10.000,00 €\", \"expected\": \"-10.000,00 €\", \"passed\": false}, {\"check\": \"control: dollars\", \"actual\": \"$1,234.50\", \"expected\": \"$1,234.50\", \"passed\": true}, {\"check\": \"control: yen\", \"actual\": \"¥1,234,567\", \"expected\": \"¥1,234,567\", \"passed\": true}, {\"check\": \"control: franc\", \"actual\": \"CHF 123'456.78\", \"expected\": \"CHF 123'456.78\", \"passed\": true}, {\"check\": \"control: dinar\", \"actual\": \"KD 1.005\", \"expected\": \"KD 1.005\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.445,"exit_code":1,"observations":[{"actual":"$-1.50","check":"regression sign-placement 1","expected":"-$1.50","passed":false},{"actual":"¥-1,000","check":"regression sign-placement 2","expected":"-¥1,000","passed":false},{"actual":"-0,50 €","check":"partial repair guard 1","expected":"-0,50 €","passed":true},{"actual":"-10.000,00 €","check":"partial repair guard 2","expected":"-10.000,00 €","passed":true},{"actual":"$1,234.50","check":"control: dollars","expected":"$1,234.50","passed":true},{"actual":"¥1,234,567","check":"control: yen","expected":"¥1,234,567","passed":true},{"actual":"CHF 123'456.78","check":"control: franc","expected":"CHF 123'456.78","passed":true},{"actual":"KD 1.005","check":"control: dinar","expected":"KD 1.005","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression sign-placement 1\", \"actual\": \"$-1.50\", \"expected\": \"-$1.50\", \"passed\": false}, {\"check\": \"regression sign-placement 2\", \"actual\": \"¥-1,000\", \"expected\": \"-¥1,000\", \"passed\": false}, {\"check\": \"partial repair guard 1\", \"actual\": \"-0,50 €\", \"expected\": \"-0,50 €\", \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": \"-10.000,00 €\", \"expected\": \"-10.000,00 €\", \"passed\": true}, {\"check\": \"control: dollars\", \"actual\": \"$1,234.50\", \"expected\": \"$1,234.50\", \"passed\": true}, {\"check\": \"control: yen\", \"actual\": \"¥1,234,567\", \"expected\": \"¥1,234,567\", \"passed\": true}, {\"check\": \"control: franc\", \"actual\": \"CHF 123'456.78\", \"expected\": \"CHF 123'456.78\", \"passed\": true}, {\"check\": \"control: dinar\", \"actual\": \"KD 1.005\", \"expected\": \"KD 1.005\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.154,"exit_code":0,"observations":[{"actual":"-$1.50","check":"regression sign-placement 1","expected":"-$1.50","passed":true},{"actual":"-¥1,000","check":"regression sign-placement 2","expected":"-¥1,000","passed":true},{"actual":"-0,50 €","check":"partial repair guard 1","expected":"-0,50 €","passed":true},{"actual":"-10.000,00 €","check":"partial repair guard 2","expected":"-10.000,00 €","passed":true},{"actual":"$1,234.50","check":"control: dollars","expected":"$1,234.50","passed":true},{"actual":"¥1,234,567","check":"control: yen","expected":"¥1,234,567","passed":true},{"actual":"CHF 123'456.78","check":"control: franc","expected":"CHF 123'456.78","passed":true},{"actual":"KD 1.005","check":"control: dinar","expected":"KD 1.005","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression sign-placement 1\", \"actual\": \"-$1.50\", \"expected\": \"-$1.50\", \"passed\": true}, {\"check\": \"regression sign-placement 2\", \"actual\": \"-¥1,000\", \"expected\": \"-¥1,000\", \"passed\": true}, {\"check\": \"partial repair guard 1\", \"actual\": \"-0,50 €\", \"expected\": \"-0,50 €\", \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": \"-10.000,00 €\", \"expected\": \"-10.000,00 €\", \"passed\": true}, {\"check\": \"control: dollars\", \"actual\": \"$1,234.50\", \"expected\": \"$1,234.50\", \"passed\": true}, {\"check\": \"control: yen\", \"actual\": \"¥1,234,567\", \"expected\": \"¥1,234,567\", \"passed\": true}, {\"check\": \"control: franc\", \"actual\": \"CHF 123'456.78\", \"expected\": \"CHF 123'456.78\", \"passed\": true}, {\"check\": \"control: dinar\", \"actual\": \"KD 1.005\", \"expected\": \"KD 1.005\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}