# parse_amount("0.29") returns 28 instead of 29. Find the bug, give a minimal diff, add 3 pytest cases.
@@ -1,4 +1,7 @@+from decimal import Decimal def parse_amount(text): """Parse "HK$1,234.50" or "1234.5" into cents.""" cleaned = text.replace("HK$", "").replace(",", "")- return int(float(cleaned) * 100)+ return int(Decimal(cleaned) * 100)✓ 3 pytest cases added
Ship the fix, not the excuse.
Opus 5.5, Sonnet 5, Haiku 4.5 and Fable 5.1 — pick the mind for the job.
