Update Weather to .NET 8 and add telemetry

This commit is contained in:
2024-01-25 16:25:59 -05:00
parent 2394f613d2
commit 5d0bc2c31c
28 changed files with 856 additions and 775 deletions

View File

@@ -1,18 +1,17 @@
using System;
using DecimalMath;
using DecimalMath;
using System;
namespace ChrisKaczor.HomeMonitor.Weather.Service
namespace ChrisKaczor.HomeMonitor.Weather.Service;
public static class Extensions
{
public static class Extensions
public static bool IsBetween<T>(this T item, T start, T end) where T : IComparable
{
public static bool IsBetween<T>(this T item, T start, T end) where T : IComparable
{
return item.CompareTo(start) >= 0 && item.CompareTo(end) <= 0;
}
public static decimal Truncate(this decimal value, int decimalPlaces)
{
return decimal.Truncate(value * DecimalEx.Pow(10, decimalPlaces)) / DecimalEx.Pow(10, decimalPlaces);
}
return item.CompareTo(start) >= 0 && item.CompareTo(end) <= 0;
}
}
public static decimal Truncate(this decimal value, int decimalPlaces)
{
return decimal.Truncate(value * DecimalEx.Pow(10, decimalPlaces)) / DecimalEx.Pow(10, decimalPlaces);
}
}