Repository navigation
Parse feet and inches when digit separators conflict with foot marks - #1754
Open
angularsen wants to merge 1 commit into
Open
angularsen wants to merge 1 commit into
angularsen wants to merge 1 commit into
Conversation
CLDR 48 changed the de-CH digit group separator to an ASCII apostrophe, which is also a foot mark. TryParseFeetInches then returned false for 1'000' 6" because it split at the first apostrophe, and silently parsed 5'10" as 510 inches because number parsing ignores group placement. Try each foot mark as the end of the feet part, and when the group separator is a foot mark, require digit groups of the culture's size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1754 +/- ##
======================================
Coverage 98% 98%
======================================
Files 515 515
Lines 24092 24099 +7
======================================
+ Hits 23692 23701 +9
+ Misses 400 398 -2
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:
|
This branch has not been deployed
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.
Follow-up to #1752. CLDR 48 (ICU on Ubuntu 26.04) changed the de-CH digit group separator from
’to', which is also a foot mark. On that data,Length.TryParseFeetIncheshad two problems:1'000' 6"false5'10"Changes
1'5' 6".5'10became 510.'separator, plus one using the host's real de-CH separator.Behavior to review
1'000"stays 1000 inches, and5'100"is 5100 inches, because those are correctly grouped numbers in that culture. Feet-and-inches notation with a 3-digit inch value is not recognized there.5'10'in such a culture now returnsfalse; it was 510 ft.ParseFeetInchesandTryParseFeetIncheschange.Length.Parse("5'10\"", de-CH)still returns 510 inches.'as the decimal separator (none in CLDR, custom cultures only) still reads5'5"as 5.5 inches.Verified locally
UnitsNet.slnxbuilds.UnitsNet.Testson net10.0 and net48 pass. Local runs use Windows ICU, so the host-separator test exercises’here and'on CI.🤖 Generated with Claude Code