Skip to content

fix: preserve fraction text and bound numeric formatting - #1063

Merged
andiwand merged 2 commits into
mainfrom
review/45-number-format-bounds
Oct 5, 2026
Merged

andiwand merged 2 commits into
mainfrom
review/45-number-format-bounds

Conversation

@andiwand

@andiwand andiwand commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Fraction formats dropped prefixes and percent signs, misread a fixed denominator followed by text (?/8" kg"), and overflowed integer rounding for large finite values. Preserve the surrounding tokens and keep rounded numerators as doubles, formatting them without narrowing to integers.

Fall back to General for unrepresentable fixed fractions and scientific mantissas. Use the shared ASCII case conversion when parsing format codes, avoiding locale-dependent behavior and signed-character undefined behavior.

Validation: rebuilt odr_test; all 41 number-format, ODF format and XLSX value tests passed. Regression assertions extend the existing fraction test; one focused test covers scientific overflow.

andiwand and others added 2 commits October 5, 2026 15:53
The new head of format_fraction keeps the prefix and percent signs, but
it lost the rule that a blank integer also blanks the separator before
the numerator, so "#-?/?" showed 0.5 as "-1/2". The from_chars result no
longer shadows the token index end, and the unreachable 32-bit guard on
the integer placeholder count is gone.

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/45-number-format-bounds branch from 9fbaaf8 to d7eaa56 Compare October 5, 2026 13:59
@andiwand
andiwand changed the base branch from review/44-font-test-fixtures to main October 5, 2026 13:59
@andiwand
andiwand merged commit 91659e6 into main Oct 5, 2026
23 checks passed
@andiwand
andiwand deleted the review/45-number-format-bounds branch October 5, 2026 14: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