Use formatter to add zeroes.

This commit is contained in:
smoogipooo 2017-04-12 20:28:04 +09:00
parent 2bb50ff082
commit 2987a57588
1 changed files with 5 additions and 4 deletions

View File

@ -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)