diff --git a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs index 26335aac9b..9402ed82f4 100644 --- a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs +++ b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -31,7 +30,7 @@ namespace osu.Game.Overlays.BeatmapSet beatmap = value; var rate = (float)beatmap.OnlineInfo.PassCount / beatmap.OnlineInfo.PlayCount; - successPercent.Text = $"{Math.Round(rate * 100)}%"; + successPercent.Text = rate.ToString("P0"); successRate.Length = rate; percentContainer.ResizeWidthTo(successRate.Length, 250, Easing.InOutCubic); diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 973769a114..22e34be34c 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -17,7 +17,6 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Users; using System.Diagnostics; -using System.Globalization; using System.Collections.Generic; using osu.Framework.Graphics.Cursor; @@ -402,7 +401,7 @@ namespace osu.Game.Overlays.Profile scoreText.Add(createScoreText("Ranked Score")); scoreNumberText.Add(createScoreNumberText(user.Statistics.RankedScore.ToString(@"#,0"))); scoreText.Add(createScoreText("Accuracy")); - scoreNumberText.Add(createScoreNumberText($"{user.Statistics.Accuracy.ToString("0.##", CultureInfo.CurrentCulture)}%")); + scoreNumberText.Add(createScoreNumberText($"{user.Statistics.Accuracy:0.##}%")); scoreText.Add(createScoreText("Play Count")); scoreNumberText.Add(createScoreNumberText(user.Statistics.PlayCount.ToString(@"#,0"))); scoreText.Add(createScoreText("Total Score")); diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs index 52b68e7b30..af336c2529 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs @@ -13,9 +13,7 @@ using osu.Game.Rulesets.Mods; using osu.Game.Screens.Select.Leaderboards; using System.Linq; using osu.Framework.Localisation; -using System.Globalization; using osu.Game.Rulesets.Scoring; -using System; using osu.Game.Rulesets.UI; namespace osu.Game.Overlays.Profile.Sections.Ranks @@ -79,9 +77,10 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks [BackgroundDependencyLoader] private void load(OsuColour colour, LocalisationEngine locale, BeatmapSetOverlay beatmapSetOverlay) { + double pp = score.PP ?? 0; stats.Add(new OsuSpriteText { - Text = $"{Math.Round(score.PP ?? 0)}pp", + Text = $"{pp:0}pp", Anchor = Anchor.TopRight, Origin = Anchor.TopRight, TextSize = 18, @@ -92,7 +91,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks { stats.Add(new OsuSpriteText { - Text = $"weighted: {Math.Round(score.PP * weight ?? 0)}pp ({weight.Value.ToString("0%", CultureInfo.CurrentCulture)})", + Text = $"weighted: {pp * weight:0}pp ({weight:P0})", Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Colour = colour.GrayA, @@ -103,7 +102,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks stats.Add(new OsuSpriteText { - Text = "accuracy: " + score.Accuracy.ToString("0.00%"), + Text = $"accuracy: {score.Accuracy:P2}", Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Colour = colour.GrayA, diff --git a/osu.Game/Overlays/Profile/Sections/RanksSection.cs b/osu.Game/Overlays/Profile/Sections/RanksSection.cs index d7df239003..3b2c9d83ed 100644 --- a/osu.Game/Overlays/Profile/Sections/RanksSection.cs +++ b/osu.Game/Overlays/Profile/Sections/RanksSection.cs @@ -155,7 +155,7 @@ namespace osu.Game.Overlays.Profile.Sections { missing.Hide(); foreach (OnlineScore score in scores) - scoreContainer.Add(new DrawableScore(score, includeWeigth ? Math.Pow(0.95, scoreContainer.Count) : -1) + scoreContainer.Add(new DrawableScore(score, includeWeigth ? Math.Pow(0.95, scoreContainer.Count) : (double?)null) { RelativeSizeAxes = Axes.X, Height = 60, diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 3b26f7bffc..dc3b012328 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -232,9 +232,9 @@ namespace osu.Game.Screens.Select double bpmMax = beatmap.ControlPointInfo.BPMMaximum; double bpmMin = beatmap.ControlPointInfo.BPMMinimum; - if (Precision.AlmostEquals(bpmMin, bpmMax)) return Math.Round(bpmMin) + "bpm"; + if (Precision.AlmostEquals(bpmMin, bpmMax)) return $"{bpmMin:0}bpm"; - return Math.Round(bpmMin) + "-" + Math.Round(bpmMax) + "bpm (mostly " + Math.Round(beatmap.ControlPointInfo.BPMMode) + "bpm)"; + return $"{bpmMin:0}-{bpmMax:0}bpm (mostly {beatmap.ControlPointInfo.BPMMode:0}bpm)"; } public class InfoLabel : Container