]> source.dussan.org Git - redmine.git/commitdiff
Round totals (#1561).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Oct 2015 22:16:59 +0000 (22:16 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Oct 2015 22:16:59 +0000 (22:16 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@14644 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue_query.rb

index 51a4fda2344d09e10df3b34397e8d8800cb53064..36f47ef0e8e3b869d0baec8bf6a0777dc6b71bb4 100644 (file)
@@ -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)