mirror of
https://github.com/ppy/osu
synced 2024-12-27 17:32:56 +00:00
Merge pull request #23367 from peppy/fix-uo-tooltip
Fix slider bar tooltips potentially showing negative zero
This commit is contained in:
commit
ec8362c6fc
@ -97,7 +97,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
// Find the number of significant digits (we could have less than 5 after normalize())
|
||||
int significantDigits = FormatUtils.FindPrecision(decimalPrecision);
|
||||
|
||||
return floatValue.ToString($"N{significantDigits}");
|
||||
string negativeSign = Math.Round(floatValue, significantDigits) < 0 ? "-" : string.Empty;
|
||||
|
||||
return $"{negativeSign}{Math.Abs(floatValue).ToString($"N{significantDigits}")}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -12,6 +12,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
/// </summary>
|
||||
public partial class TimeSlider : RoundedSliderBar<double>
|
||||
{
|
||||
public override LocalisableString TooltipText => $"{Current.Value:N0} ms";
|
||||
public override LocalisableString TooltipText => $"{base.TooltipText} ms";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user