mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-02-02 01:25:39 -05:00
Add aggregate API
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using DecimalMath;
|
||||
|
||||
namespace ChrisKaczor.HomeMonitor.Weather.Service
|
||||
{
|
||||
@@ -8,5 +9,10 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service
|
||||
{
|
||||
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