From 25bf820edc0bcb102c684bc8740e386fcef9dfa9 Mon Sep 17 00:00:00 2001 From: Don Cruse Date: Thu, 18 Jul 2013 23:48:33 -0500 Subject: [PATCH] Simplufying interpolation method --- app/controllers/stats_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 65ac6739..405aafbd 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -41,10 +41,13 @@ class StatsController < ApplicationController end def interpolate_avg_for_current_month(set) - percent_of_month = Time.zone.now.day.to_f / Time.zone.now.end_of_month.day.to_f (set[0]*(1/percent_of_month) + set[1] + set[2]) / 3.0 end + def percent_of_month + Time.zone.now.day / Time.zone.now.end_of_month.day.to_f + end + def actions_done_last_years @page_title = t('stats.index_title') @chart = Stats::Chart.new('actions_done_lastyears_data', :height => 400, :width => 900)