Skip to content

fix: the EDS typed-k and factors sheets read either decimal separator - #72

Merged
Paullo9 merged 1 commit into
mainfrom
claude/decimal-separator
Nov 5, 2026
Merged

Paullo9 merged 1 commit into
mainfrom
claude/decimal-separator

Conversation

@Paullo9

@Paullo9 Paullo9 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Paul

Fixes #71.

Break: on a German-locale Mac the typed-k sheet read 1.9476 as 19476 (and the full 1.9476274264058098 as 19.476.300.000.000), because SwiftUI's bare .number parse takes a period as grouping in a comma region. Quantify then ran with that k, with no warning. The zeta / cross-section sheet has the same six-field pattern.

Fix: EDXSheetNumber.format(digits:) wraps the sheets' format in DecimalEntryFormat, the rule NumericField / OptionalNumericField / NumberEntryField already use. One . or , is the decimal point; well-formed grouping is grouping; anything else is refused and the field keeps its last value. The shown value is ungrouped. Fields changed: k and σ in EDXTypedKSheet; the factor, beam current, live time and probe area in EDXFactorsSheet. No other TextField(value:format:) with a bare .number remains in MacEMUI, and mac4DSTEM and macTEM have none.

Numbers people type: yes, this changes what a typed number becomes. Left without auto-merge, for Paul.

typed (de_DE) before after
1.9476 19476 (the app showed 19.476.300.000.000 for the 16-digit 1.9476274264058098) 1.9476
1,9476 1.9476 1.9476
1.9.476 1 refused (field keeps its value)
en_US 1.9476 / 1,9476 1.9476 / 19476 1.9476 / 1.9476

Test: ShellSpectroscopyTests/EDXSheetNumberTests, under de_DE and en_US. It pins the old format's misreading as the reproduction, both separators as the decimal point, refusal of ambiguous text, and a round trip of the shown value. 4/4 pass; ShellSpectroscopyTests and ShellControlsTests are green (swift test --parallel).

🤖 Generated with Claude Code

On a German-locale Mac the typed-k sheet read "1.9476" as 19 476 300 000 000: its fields used SwiftUI's bare .number format,
whose parse takes a period for grouping in a comma region, and Quantify ran with it. The six fields of the typed-k and
zeta / cross-section sheets now parse through DecimalEntryFormat, the rule the shared numeric fields already use: one . or ,
is the decimal point, well-formed grouping is grouping, anything else is refused.

Fixes #71.

Done: the sheets read 1.9476 and 1,9476 alike. Next: the typed-k sheet's container identifier (separate issue).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Paullo9 Paullo9 self-assigned this Nov 5, 2026
@Paullo9
Paullo9 merged commit 02971a8 into main Nov 5, 2026
6 checks passed
@Paullo9
Paullo9 deleted the claude/decimal-separator branch November 5, 2026 12:43
@macem-release macem-release Bot mentioned this pull request Nov 5, 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.

polish: the EDS typed-k and factors sheets read 1.9476 as 19 476 300 000 000 on a German Mac

1 participant