Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

fix invalid truncating float value

as-op727fe104349c
diff --git a/modules/reporting/app/models/cost_query/result.rb b/modules/reporting/app/models/cost_query/result.rb
index a04cfa067cf..8690ae253e2 100644
--- a/modules/reporting/app/models/cost_query/result.rb
+++ b/modules/reporting/app/models/cost_query/result.rb
@@ -65,7 +65,7 @@ class CostQuery::Result < Report::Result
start = start_timestamp
return nil if start.nil?
- start + self["units"].to_i.hours
+ start + self["units"].to_f.hours
end
private
diff --git a/modules/reporting/lib/widget/table/entry_table.rb b/modules/reporting/lib/widget/table/entry_table.rb
index cf5aeaa8470..513934a3f0c 100644
--- a/modules/reporting/lib/widget/table/entry_table.rb
+++ b/modules/reporting/lib/widget/table/entry_table.rb
@@ -141,7 +141,7 @@ class Widget::Table::EntryTable < Widget::Table
rows << (content_tag(:tr) do
concat body_column_field(:spent_on, result)
if with_times_column?
- concat content_tag :td, spent_on_time_representation(result.start_timestamp, result["units"].to_i),
+ concat content_tag :td, spent_on_time_representation(result.start_timestamp, result["units"].to_f),
class: "start_time right",
"raw-data": result.start_timestamp.to_s
end