Repository navigation
fix numbers with hundreds inside a thousand or million group - #1254
Merged
spencermountain merged 2 commits intoOct 29, 2026
Merged
Conversation
'two million three hundred forty five thousand' parsed as 2000345000:
when a smaller group with hundreds ended in a bigger multiple
('three hundred forty five thousand'), the whole running sum was
multiplied, including the millions already counted. Only multiply
the part that came after the last bigger multiple.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
toText() turned 123456 into 'one hundred thousand twenty three thousand ...', because 'hundred thousand' and 'thousand' were written as separate magnitudes. When a 'hundred <unit>' is followed by its <unit>, write 'hundred' and let the next group add the unit: 'one hundred twenty three thousand ...'. This needs the parse fix before it, since toOrdinal() re-parses the text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
|
wow! thank you Wei-Lun!! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Numbers with a hundreds digit inside a bigger group went wrong in both directions:
They go together: toOrdinal() re-parses the text, so the toText change alone would turn 1994683 into 'one billion …'. Added cases to the number-parse and to-text tests; they fail on dev (11 of 85) and pass with the change. The full suite and the plugin suites pass.
I used Claude Code to write this change.