diff --git a/osu.Game/Graphics/UserInterfaceV2/FormSliderBar.cs b/osu.Game/Graphics/UserInterfaceV2/FormSliderBar.cs index cc0e7d5052..e228491880 100644 --- a/osu.Game/Graphics/UserInterfaceV2/FormSliderBar.cs +++ b/osu.Game/Graphics/UserInterfaceV2/FormSliderBar.cs @@ -330,7 +330,11 @@ namespace osu.Game.Graphics.UserInterfaceV2 break; case Bindable bindableDouble: - bindableDouble.Value = double.Parse(textBox.Current.Value); + bindableDouble.Value = double.Parse(textBox.Current.Value) / (DisplayAsPercentage ? 100 : 1); + break; + + case Bindable bindableFloat: + bindableFloat.Value = float.Parse(textBox.Current.Value) / (DisplayAsPercentage ? 100 : 1); break; default: @@ -397,7 +401,18 @@ namespace osu.Game.Graphics.UserInterfaceV2 { if (updatingFromTextBox) return; - textBox.Text = currentNumberInstantaneous.Value.ToStandardFormattedString(OsuSliderBar.MAX_DECIMAL_DIGITS); + if (DisplayAsPercentage) + { + double floatValue = double.CreateTruncating(currentNumberInstantaneous.Value); + + if (currentNumberInstantaneous.Value is int) + floatValue /= 100; + + textBox.Text = floatValue.ToStandardFormattedString(Math.Max(0, OsuSliderBar.MAX_DECIMAL_DIGITS - 2)); + } + else + textBox.Text = currentNumberInstantaneous.Value.ToStandardFormattedString(OsuSliderBar.MAX_DECIMAL_DIGITS); + valueLabel.Text = LabelFormat(currentNumberInstantaneous.Value); }