From: Jean-Philippe Lang Date: Sun, 4 Oct 2015 22:16:59 +0000 (+0000) Subject: Round totals (#1561). X-Git-Tag: 3.2.0~203 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e35d036bdae514338d4a499bfaaaf21d06def1b7;p=redmine.git Round totals (#1561). git-svn-id: http://svn.redmine.org/redmine/trunk@14644 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb index 51a4fda23..36f47ef0e 100644 --- a/app/models/issue_query.rb +++ b/app/models/issue_query.rb @@ -314,12 +314,12 @@ class IssueQuery < Query # Returns sum of all the issue's estimated_hours def total_for_estimated_hours - base_scope.sum(:estimated_hours) + base_scope.sum(:estimated_hours).to_f.round(2) end # Returns sum of all the issue's time entries hours def total_for_spent_hours - base_scope.joins(:time_entries).sum("#{TimeEntry.table_name}.hours") + base_scope.joins(:time_entries).sum("#{TimeEntry.table_name}.hours").to_f.round(2) end def total_for_custom_field(custom_field)