roadie/Roadie.Api.Library/Extensions/LongExt.cs

17 lines
367 B
C#
Raw Normal View History

2018-11-03 21:21:36 +00:00
using Roadie.Library.Utility;
using System;
namespace Roadie.Library.Extensions
{
public static class LongExt
{
public static string ToFileSize(this long? l)
{
2018-11-04 20:33:37 +00:00
if (!l.HasValue)
2018-11-03 21:21:36 +00:00
{
return "0";
}
return String.Format(new FileSizeFormatProvider(), "{0:fs}", l);
}
}
2018-11-04 20:33:37 +00:00
}