Пример #1
0
        public static double GetCurrentGrowthFactor(ICoronaEntry now, ICoronaEntry today, ICoronaEntry yesterday)
        {
            var todayGrowth      = GetGrowthFactor(now, today);
            var yesteredayGrowth = GetGrowthFactor(today, yesterday);
            var moreToday        = todayGrowth > yesteredayGrowth;

            return(moreToday ? todayGrowth : yesteredayGrowth);
        }
Пример #2
0
        public static double GetGrowthFactor(ICoronaEntry current, ICoronaEntry past)
        {
            var res = (double)current.CaseIncrease / past.CaseIncrease;

            if (double.IsNaN(res))
            {
                return(0);
            }

            return(res);
        }