1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Fix effect point multiplier text box displaying too much decimal digits

This commit is contained in:
Bartłomiej Dach 2022-01-08 16:12:52 +01:00
parent 34135138b6
commit 9370e84460
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Globalization;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -9,6 +10,7 @@ using osu.Framework.Graphics.UserInterface;
using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Overlays.Settings;
using osu.Game.Utils;
namespace osu.Game.Screens.Edit.Timing
{
@ -66,7 +68,8 @@ namespace osu.Game.Screens.Edit.Timing
Current.BindValueChanged(val =>
{
textBox.Text = val.NewValue.ToString();
decimal decimalValue = slider.Current.Value.ToDecimal(NumberFormatInfo.InvariantInfo);
textBox.Text = decimalValue.ToString($@"N{FormatUtils.FindPrecision(decimalValue)}");
}, true);
}