Files
WowUp/WowUp.Common/Extensions/IntExtensions.cs
jliddev 182bcef037 Wow Interface integration
Add default headers to most Http calls.
Add WowInterface addon provider.
Increase TukUI Cache time from 10 -> 60 minutes.
2020-08-16 23:45:59 -05:00

24 lines
599 B
C#

namespace WowUp.Common.Extensions
{
public static class IntExtensions
{
public static string FormatDownloadCount(this int downloadCount)
{
var suffix = string.Empty;
var value = (double)downloadCount;
if (downloadCount >= 1000000)
{
suffix = "million";
value /= 1000000.0;
}
else if (downloadCount >= 1000)
{
suffix = "thousand";
value /= 1000.0;
}
return $"{value:0.0} {suffix}";
}
}
}