Skip to content

fix: parse quantities independently of the host locale - #1036

Merged
andiwand merged 2 commits into
mainfrom
review/18-quantity-parsing
Oct 5, 2026
Merged

andiwand merged 2 commits into
mainfrom
review/18-quantity-parsing

Conversation

@andiwand

@andiwand andiwand commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Quantity parsing now reads decimal magnitudes independently of the host locale, preserving exponent notation and units such as em. Integral magnitudes are checked before conversion and format without locale grouping. Significant-digit arithmetic uses fixed-width integers and cannot overflow on extreme precision arguments.

Validation: 93 numeric and HTML tests pass; public headers compile as C++20. Regressions cover comma-decimal locales, grouped integer output, exponent/unit boundaries, and conversion limits.

@andiwand
andiwand force-pushed the review/17-crypto-blocks branch from 2728d90 to 44e177f Compare October 4, 2026 21:18
Base automatically changed from review/17-crypto-blocks to main October 5, 2026 05:49
andiwand and others added 2 commits October 5, 2026 07:49
The shortened comments lost reasons that the code does not show: why
format_magnitude uses 7 digits, why the default unit is registered, that
number::parse refuses a unit, and that extra digits show float noise.
Each reason is back in one or two lines. quantity.cpp also includes
string_util.hpp, because it uses is_ascii_digit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gb1fLafqqzehpqPuU6uBfn
@andiwand
andiwand force-pushed the review/18-quantity-parsing branch from 2b39e8e to 28a6be0 Compare October 5, 2026 05:58
@andiwand
andiwand merged commit 08b969f into main Oct 5, 2026
23 checks passed
@andiwand
andiwand deleted the review/18-quantity-parsing branch October 5, 2026 06:00
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