Avoid float conversion when calculating progress

This commit is contained in:
Björn Geuken 2015-05-16 15:19:03 +02:00
parent 5043d26cc5
commit 1862534b2c
2 changed files with 4 additions and 6 deletions

View file

@ -211,7 +211,7 @@ class Event < ActiveRecord::Base
def calculate_progress
result = self.progress_status
true_items = result.select { |_key, value| value }.length
(true_items / result.length.to_f * 100).round(0).to_s
(100 * true_items / result.length).to_s
end
private