Simplufying interpolation method

This commit is contained in:
Don Cruse 2013-07-18 23:48:33 -05:00
parent 3d2c048c44
commit 25bf820edc

View file

@ -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)