< Summary

Class:ExploreV2CommonUtils
Assembly:ExploreV2
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExploreV2/Scripts/Common/ExploreV2CommonUtils.cs
Covered lines:3
Uncovered lines:0
Coverable lines:3
Total lines:18
Line coverage:100% (3 of 3)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
FormatNumberToString(...)0%330100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExploreV2/Scripts/Common/ExploreV2CommonUtils.cs

#LineLine coverage
 1/// <summary>
 2/// Utils related to the events management in ExploreV2.
 3/// </summary>
 4public static class ExploreV2CommonUtils
 5{
 6    /// <summary>
 7    /// Converts a number to string using up to 2 decimals if needed.
 8    /// </summary>
 9    /// <param name="numberToFormat">Number to convert.</param>
 10    /// <returns>A formatted string.</returns>
 11    public static string FormatNumberToString(int numberToFormat)
 12    {
 713        float dividedNumber = numberToFormat >= 1000 ? (numberToFormat / 1000f) : numberToFormat;
 714        string result = numberToFormat >= 1000 ? $"{string.Format("{0:0.##}", dividedNumber)}k" : $"{dividedNumber}";
 15
 216        return result;
 17    }
 18}