Exemplo n.º 1
0
        public static decimal AverageValue(this ExchangeHistory.ItemData itemData, int fromDays, int numberOfDays)
        {
            var average = 0m;

            if (itemData.ChaosValuePerDay.Count > 0)
            {
                for (var days = fromDays; days < fromDays + numberOfDays; days++)
                {
                    average += days < itemData.ChaosValuePerDay.Count ? itemData.ChaosValuePerDay[days] : itemData.ChaosValuePerDay[itemData.ChaosValuePerDay.Count - 1];
                }
            }

            return(average / numberOfDays);
        }
Exemplo n.º 2
0
 public static decimal AverageValue(this ExchangeHistory.ItemData itemData, int numberOfDays)
 {
     return(AverageValue(itemData, 0, numberOfDays));
 }