mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 06:42:54 +08: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())
|
// Find the number of significant digits (we could have less than 5 after normalize())
|
||||||
int significantDigits = FormatUtils.FindPrecision(decimalPrecision);
|
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>
|
/// <summary>
|
||||||
|
@ -12,6 +12,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class TimeSlider : RoundedSliderBar<double>
|
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