| | 1 | | /// <summary> |
| | 2 | | /// Utils related to the events management in ExploreV2. |
| | 3 | | /// </summary> |
| | 4 | | public 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 | | { |
| 7 | 13 | | float dividedNumber = numberToFormat >= 1000 ? (numberToFormat / 1000f) : numberToFormat; |
| 7 | 14 | | string result = numberToFormat >= 1000 ? $"{string.Format("{0:0.##}", dividedNumber)}k" : $"{dividedNumber}"; |
| | 15 | |
|
| 2 | 16 | | return result; |
| | 17 | | } |
| | 18 | | } |