summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-04 22:16:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-04 22:16:59 +0000
commite35d036bdae514338d4a499bfaaaf21d06def1b7 (patch)
tree3b7f32d163c8a0f3f031b4fc602f470790945691
parent0c0b6fea736691f777e14ab87f661377c9286469 (diff)
downloadredmine-e35d036bdae514338d4a499bfaaaf21d06def1b7.tar.gz
redmine-e35d036bdae514338d4a499bfaaaf21d06def1b7.zip
Round totals (#1561).
git-svn-id: http://svn.redmine.org/redmine/trunk@14644 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/issue_query.rb4
1 files changed, 2 insertions, 2 deletions
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)