1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:02:55 +08:00

Make comma separators optional.

This commit is contained in:
Dean Herbert 2017-04-14 20:09:01 +09:00
parent ac3b435f00
commit ed3956eca5
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -5,7 +5,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using System;
using osu.Framework.Allocation;
namespace osu.Game.Graphics.UserInterface
{
@ -16,6 +15,8 @@ namespace osu.Game.Graphics.UserInterface
protected override double RollingDuration => 1000;
protected override EasingTypes RollingEasing => EasingTypes.Out;
public bool UseCommaSeparator;
/// <summary>
/// How many leading zeroes the counter has.
/// </summary>
@ -43,8 +44,9 @@ namespace osu.Game.Graphics.UserInterface
protected override string FormatCount(double count)
{
string format = new string('0', (int)LeadingZeroes);
for (int i = format.Length - 3; i > 0; i -= 3)
format = format.Insert(i, @",");
if (UseCommaSeparator)
for (int i = format.Length - 3; i > 0; i -= 3)
format = format.Insert(i, @",");
return ((long)count).ToString(format);
}