Free diskspace in UI

New: View Diskspace for root directories visible in UI
#ND-98 fixed
This commit is contained in:
Mark McDowall 2012-12-22 21:35:36 -08:00
commit 4212da9146
9 changed files with 95 additions and 32 deletions

View file

@ -112,6 +112,12 @@ namespace NzbDrone.Core
private const Decimal ONE_GIGABYTE = ONE_MEGABYTE * 1024M;
public static string ToBestFileSize(this long bytes, int precision = 0)
{
var ulongBytes = (ulong)bytes;
return ulongBytes.ToBestFileSize(precision);
}
public static string ToBestFileSize(this ulong bytes, int precision = 0)
{
if (bytes == 0)
return "0B";