mirror of
https://github.com/WowUp/WowUp.git
synced 2026-04-21 06:17:46 -04:00
Add default headers to most Http calls. Add WowInterface addon provider. Increase TukUI Cache time from 10 -> 60 minutes.
24 lines
599 B
C#
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}";
|
|
}
|
|
}
|
|
}
|