summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/version_reports_helper.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/version_reports_helper.rb b/app/helpers/version_reports_helper.rb
index 930ac3d..71b4f3f 100644
--- a/app/helpers/version_reports_helper.rb
+++ b/app/helpers/version_reports_helper.rb
@@ -54,7 +54,7 @@ module VersionReportsHelper
def hour_budget_error(issue)
return unless @show_time || @show_money
time_budget = (custom_field_value(issue, :hours) || 0).to_i
- money_budget = (custom_field_value(issue, :money) || 0).to_i
+ money_budget = to_float(custom_field_value(issue, :money)||0).round
if time_budget != 0
if issue.total_spent_hours.round != time_budget
if issue.total_spent_hours < time_budget
@@ -116,7 +116,11 @@ module VersionReportsHelper
# drops currency in a string.
def to_float(string)
- string.gsub(/[^0-9\.]/, '').to_f
+ if string.is_a? String
+ string.gsub(/[^0-9\.]/, '').to_f
+ else
+ string.to_f
+ end
end
end