diff --git a/osu.Game.Tests/Visual/RankedPlay/TestSceneRankedPlayCard.cs b/osu.Game.Tests/Visual/RankedPlay/TestSceneRankedPlayCard.cs index a1a449b703..7f2c87bed0 100644 --- a/osu.Game.Tests/Visual/RankedPlay/TestSceneRankedPlayCard.cs +++ b/osu.Game.Tests/Visual/RankedPlay/TestSceneRankedPlayCard.cs @@ -108,7 +108,9 @@ namespace osu.Game.Tests.Visual.RankedPlay Retries = Enumerable.Range(-2, 100).Select(x => x % 12 - 6).ToArray(), }; - beatmap.StarRating = i + 1; + // the .009 part exercises behaviour of truncating star rating to 2dp + // it should be discarded completely on display + beatmap.StarRating = i + 1.009; flow.Add(new RankedPlayCardContent(beatmap) { diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Card/RankedPlayCardContent.Metadata.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Card/RankedPlayCardContent.Metadata.cs index 2b935acca6..3e1b880d81 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Card/RankedPlayCardContent.Metadata.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Card/RankedPlayCardContent.Metadata.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -12,6 +11,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Online.API.Requests.Responses; +using osu.Game.Utils; using osuTK; namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Card @@ -107,7 +107,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Card }, new TruncatingSpriteText { - Text = FormattableString.Invariant($"{beatmap.StarRating:F2}"), + Text = beatmap.StarRating.FormatStarRating(), Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Font = OsuFont.GetFont(size: 9, weight: FontWeight.Bold),