Skip to content

Read 12,5 as 12.5 when normalising amounts - #5

Merged
aghasalim merged 1 commit into
mainfrom
comma-decimal-amounts
Oct 9, 2026
Merged

aghasalim merged 1 commit into
mainfrom
comma-decimal-amounts

Conversation

@aghasalim

Copy link
Copy Markdown
Owner

_norm_amount treated a lone comma as a thousands separator unless exactly two digits followed it, so "12,5" became 125.0. A comma is now a thousands separator only when every group after it has exactly three digits (1,204 or 12,000,000); otherwise it is a decimal comma. verify/score.c had the same rule and gets the same fix, checked on a copy of the reports with seven extra comma cases (the old C disagrees on 4 field verdicts, the new one on none). Parametrized test added; two cases fail on the old code. Rescoring every stored prediction with the new rule changes no verdict, so no published numbers change.

Co-authored-by: aghasalim 75713741+aghasalim@users.noreply.github.com

_norm_amount treated a lone comma as a thousands separator unless exactly two digits followed it, so "12,5" became 125.0. A comma is now a thousands separator only when every group after it has exactly three digits (1,204 or 12,000,000); otherwise it is a decimal comma. verify/score.c had the same rule and gets the same fix, checked on a copy of the reports with seven extra comma cases (the old C disagrees on 4 field verdicts, the new one on none). Parametrized test added; two cases fail on the old code. Rescoring every stored prediction with the new rule changes no verdict, so no published numbers change.

Co-authored-by: aghasalim <75713741+aghasalim@users.noreply.github.com>
@aghasalim
aghasalim merged commit 753ea75 into main Oct 9, 2026
2 checks passed
@aghasalim
aghasalim deleted the comma-decimal-amounts branch October 9, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant