mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:20:04 +08:00
Ensure negative sign is only applied when the post-rounded result is negative
This commit is contained in:
parent
63890ef6fe
commit
ad40099e32
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user