Commit 5e0f9114ac86938eb1ff60d923276a51940d3b54
1 parent
30299524
Exists in
master
and in
1 other branch
Rounding average votes to nearest integer
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/question.rb
... | ... | @@ -216,7 +216,7 @@ class Question < ActiveRecord::Base |
216 | 216 | average = 0.0 |
217 | 217 | end |
218 | 218 | |
219 | - result.merge!(:average_votes => (average*100).round / 100.0) # round to 2 decimals | |
219 | + result.merge!(:average_votes => average.round) # round to 2 decimals | |
220 | 220 | end |
221 | 221 | |
222 | 222 | return result | ... | ... |