public double Calculate(RaceTimeInputViewModel input)
        {
            var time   = TimeSpan.Parse(input.Hours.ToString() + ":" + input.Minutes.ToString() + ":" + input.Seconds.ToString());
            var result = time.TotalMinutes * Math.Pow(2, 1.20);

            return(result);
        }
예제 #2
0
        public IActionResult RacePredictor(RaceTimeInputViewModel input)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(input));
            }

            var result = this.calculatorsService.Calculate(input);

            this.ViewBag.Result = TimeSpan.FromMinutes(result).ToString("hh\\:mm\\:ss");

            return(this.View());
        }