Use format string for double instead of Math.Round.

This commit is contained in:
Huo Yaoyuan
2017-10-15 16:44:15 +08:00
parent 192ebe776f
commit 9b3676c562
3 changed files with 7 additions and 6 deletions

View File

@ -79,9 +79,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 +93,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
{
stats.Add(new OsuSpriteText
{
Current = locale.Format($"weighted: {score.PP * weight ?? 0:0}pp ({weight:0%})"),
Text = $"weighted: {pp * weight:0}pp ({weight:P0})",
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Colour = colour.GrayA,
@ -103,7 +104,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,