Parse quantity format suffixes invariantly#1689
Conversation
Extracted from #1544 (#1544) because format-string parsing is unrelated to QuantityValue and is a standalone correctness improvement for the existing formatter. Moving it out keeps the feature PR focused and lets this behavior ship independently. Changes: - Parse significant-digit, abbreviation-index, currency, and percent suffixes with invariant culture. - Apply the same parsing rules to the span-based and .NET Framework-compatible code paths. Tests: - Add Format_CustomSpecifierSuffix_ParsesUsingInvariantCulture for abbreviation and significant-digit formats. - Verify both net10.0 and net48 QuantityFormatterTests (138 tests per target).
ReviewSmall, well-scoped bug fix — no generated code, unit definitions, or public API surface touched. Breaking changes: None. No public signatures changed. The only behavior change is that format-string suffixes ( Style/conventions: Consistent with the surrounding code — mirrors the existing Generated code / new quantities: N/A — no changes to Correctness: Confirmed the fix is complete — grepped the codebase and Test coverage: Nit: The PR body says "Verify both net10.0 and net48 QuantityFormatterTests (138 tests per target)" — might be worth double-checking that count is accurate/intentional if it's meant as a checklist item, but this is a documentation-only concern and doesn't affect the code. Overall: correct, minimal, well-tested fix. LGTM. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1689 +/- ##
======================================
Coverage 96% 96%
======================================
Files 456 456
Lines 30107 30107
======================================
Hits 29043 29043
Misses 1064 1064
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Extracted from #1544 because format-string parsing is unrelated to QuantityValue and is a standalone correctness improvement for the existing formatter. Moving it out keeps the feature PR focused and lets this behavior ship independently.
Changes:
Tests: