Skip to content

Fix cleanup of adjacent numeric separators - #76

Merged
dy merged 1 commit into
jkroso:masterfrom
umtong:fix/adjacent-numeric-separators
Oct 25, 2026
Merged

dy merged 1 commit into
jkroso:masterfrom
umtong:fix/adjacent-numeric-separators

Conversation

@umtong

@umtong umtong commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

The separator cleanup consumes the digit after each match, so it skips the next separator when only one digit separates them. For example, parse('1_2_3s') returns 3012 instead of 123000.

Use a lookahead for the following digit so every separator between digits is removed. This also fixes adjacent locale group separators and placeholders in fractional values.

Validation: all 106 existing tests pass. A separate 17-case reproduction covering placeholders, grouping, decimals, signs, output units, and German locale values also passes.

Prepared with OpenAI Codex assistance.

@dy
dy merged commit 1697bbc into jkroso:master Oct 25, 2026
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.

2 participants