Repository navigation
Conversation
The HTML number input always exchanges its text with '.' as the decimal separator, but UINumberInput.Value parsed it, and GUI.Value wrote it, with the current culture. In cultures such as tr-TR, "1.5" was read as 15 and Value(1.5) wrote "1,5", which the number input rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Pull request type
What is the current behavior?
Issue Number: N/A
UINumberInput.ValueparsesTextwithdouble.TryParse(Text, out var value)andGUI.Value(this IUINumberInput, double)writes it back withsafeValue.ToString(), both in the current culture. The Blazor presenter renders the control as an HTML number input (TextBoxTypes.Number), whose text always uses.as the decimal separator. On a machine with the Turkish culture (and others with,as the decimal separator):"1.5"is parsed as15(.is the group separator there);Value(1.5)writes"1,5", which a number input doesn't accept.What is the new behavior?
Valueparses withNumberStyles.FloatandCultureInfo.InvariantCulture.GUI.Value(...)writes withToString(CultureInfo.InvariantCulture).UINumberInputTests(tr-TR set inside the tests):Value_ParsesTextWithInvariantCultureandValueExtension_WritesTextWithInvariantCulture. Both fail without the change (Expected: 1,5, Actual: 15andExpected: "1.5", Actual: "1,5") and pass with it.Other information
Found by reading the code, not from an issue. I didn't run the app UI, so the number input's separator behaviour comes from the presenter code, not from observing it. The change only matters for tools that use
GUI.NumberInput/GUI.Value. Locally I pinnedglobal.jsonto the SDK I have (8.0.100 isn't installed); that change isn't in the commit.This change was written with Claude Code.
Quality check
DevToys.UnitTests152/152, net8.0)🤖 Generated with Claude Code