From 2987a575888f155d3753cac0026259d70bc7cd93 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 12 Apr 2017 20:28:04 +0900 Subject: [PATCH] Use formatter to add zeroes. --- osu.Game/Graphics/UserInterface/ScoreCounter.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/ScoreCounter.cs b/osu.Game/Graphics/UserInterface/ScoreCounter.cs index a9f402b13d..1221d2b0c2 100644 --- a/osu.Game/Graphics/UserInterface/ScoreCounter.cs +++ b/osu.Game/Graphics/UserInterface/ScoreCounter.cs @@ -48,10 +48,11 @@ protected override double GetProportionalDuration(double currentValue, double ne protected override string FormatCount(double count) { - string s = ((long)count).ToString("D" + LeadingZeroes); - for (int i = s.Length - 3; i > 0; i -= 3) - s = s.Insert(i, ","); - return s; + string format = new string('0', (int)LeadingZeroes); + for (int i = format.Length - 3; i > 0; i -= 3) + format = format.Insert(i, @","); + + return ((long)count).ToString(format); } public override void Increment(double amount)