mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-31 09:35:40 -05:00
Update Weather to .NET 8 and add telemetry
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user