diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index d2991fd25..708a8acfb 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -309,7 +309,7 @@ module QueriesHelper else format_object(value, html: false) do |value| case value.class.name - when 'Float' + when 'Float', 'Rational' sprintf("%.2f", value).gsub('.', l(:general_csv_decimal_separator)) when 'IssueRelation' value.to_s(object) diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index cd26f1b13..93b4c271b 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -1740,6 +1740,16 @@ class TimelogControllerTest < Redmine::ControllerTest get :index, :params => {:format => 'csv'} assert_response :success assert_equal 'text/csv; header=present', response.media_type + + parsed_csv = CSV.parse(response.body) + assert_equal %w[Project Date User Activity Issue Comment Hours], parsed_csv.first + assert_equal( + [ + 'eCookbook', '03/12/2007', 'Redmine Admin', 'Design', + 'Bug #1: Cannot print recipes', '', '150.00' + ], + parsed_csv.last + ) end end