Created S# .sln and moved project to src folder

This commit is contained in:
jeff.thompson
2017-06-21 22:41:54 -04:00
commit 52948a6e7e
93 changed files with 10647 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using System;
using System.Text;
namespace ICD.Common.Utils.Extensions
{
public static class TimeSpanExtensions
{
public static string ToReadableString(this TimeSpan extends)
{
if (extends == null)
throw new ArgumentNullException("extends");
StringBuilder builder = new StringBuilder();
if (extends.Days > 0)
builder.AppendFormat("{0} days, ", extends.Days);
if (extends.Hours > 0)
builder.AppendFormat("{0} hours, ", extends.Hours);
if (extends.Minutes > 0)
builder.AppendFormat("{0} minutes, ", extends.Minutes);
if (extends.Seconds > 0)
builder.AppendFormat("{0} seconds, ", extends.Seconds);
if (extends.Milliseconds > 0)
{
builder.AppendFormat("{0}.{1} ms", extends.Milliseconds,
((double)extends.Ticks / TimeSpan.TicksPerMillisecond) - extends.TotalMilliseconds);
}
return builder.ToString();
}
}
}