Fix some numeric settings not working correct in some languages when attempting to set negative value#37667
Merged
peppy merged 2 commits intoppy:masterfrom May 8, 2026
Merged
Conversation
…attempting to set negative value Closes ppy#37553. You can probably tell by the title that this is going to be a good one. As previously mentioned in ppy#35395, framework-side `TextBox` uses a bunch of `NumberFormat` properties from `CurrentCulture` to contextually allow decimal points or minus signs in a textbox. In some languages, namely (of the ones we support): Finnish, Croatian, Lithuanian, Norsk, Slovenian, and Swedish, `NumberFormat.NegativeSign` is not U+002D HYPHEN MINUS, but instead U+2212 MINUS SIGN. Therefore, in `FormSliderBar`, when `ToStandardFormattedString()` is attempted to be used to set the textbox value, the hardcoded U+002D HYPHEN MINUS is rejected on cultures that expect U+2212 MINUS SIGN, and thus due to a feedback loop, all negative values are no longer settable. This applies the obvious fix of applying `NumberFormat.NegativeSign`.
peppy
approved these changes
May 8, 2026
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.
Closes #37553.
You can probably tell by the title that this is going to be a good one.
As previously mentioned in #35395, framework-side
TextBoxuses a bunch ofNumberFormatproperties fromCurrentCultureto contextually allow decimal points or minus signs in a textbox.In some languages, namely (of the ones we support): Finnish, Croatian, Lithuanian, Norsk, Slovenian, and Swedish,
NumberFormat.NegativeSignis notU+002D HYPHEN MINUS, but insteadU+2212 MINUS SIGN. Therefore, inFormSliderBar, whenToStandardFormattedString()is attempted to be used to set the textbox value, the hardcodedU+002D HYPHEN MINUSis rejected on cultures that expectU+2212 MINUS SIGN, and thus due to a feedback loop, all negative values are no longer settable.This applies the obvious fix of applying
NumberFormat.NegativeSign.