2020-02-04 12:18:19 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2020-02-04 12:17:23 +08:00
|
|
|
namespace osu.Game.Utils
|
|
|
|
{
|
2020-02-04 12:36:22 +08:00
|
|
|
public static class FormatUtils
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-02-04 12:17:23 +08:00
|
|
|
/// Turns the provided accuracy into a percentage with 2 decimal places.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="accuracy">The accuracy to be formatted</param>
|
|
|
|
/// <returns>formatted accuracy in percentage</returns>
|
2020-02-08 05:09:45 +08:00
|
|
|
public static string FormatAccuracy(this double accuracy) => $"{accuracy:0.00%}";
|
2020-02-04 12:17:23 +08:00
|
|
|
|
2020-02-04 12:36:22 +08:00
|
|
|
/// <summary>
|
2020-02-04 12:17:23 +08:00
|
|
|
/// Turns the provided accuracy into a percentage with 2 decimal places.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="accuracy">The accuracy to be formatted</param>
|
|
|
|
/// <returns>formatted accuracy in percentage</returns>
|
2020-02-08 05:09:45 +08:00
|
|
|
public static string FormatAccuracy(this decimal accuracy) => $"{accuracy:0.00}%";
|
2020-02-04 12:36:22 +08:00
|
|
|
}
|
|
|
|
}
|