diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-26 19:46:57 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-26 19:46:57 +0000 |
commit | a4a8b6381e4a162da85319e216a770ee7bd82202 (patch) | |
tree | 9db63e7eb87f36981ab4b551e9df0c4658d530ff /app/helpers/timelog_helper.rb | |
parent | 864ac367e85160b523b2f05522cbf0d3f2d65c0d (diff) | |
download | redmine-a4a8b6381e4a162da85319e216a770ee7bd82202.tar.gz redmine-a4a8b6381e4a162da85319e216a770ee7bd82202.zip |
Adds a key in lang files (general_csv_decimal_separator) to set the decimal separator (point or comma) in csv exports (#1372).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1591 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/timelog_helper.rb')
-rw-r--r-- | app/helpers/timelog_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb index db13556a1..7fd70e744 100644 --- a/app/helpers/timelog_helper.rb +++ b/app/helpers/timelog_helper.rb @@ -44,6 +44,7 @@ module TimelogHelper def entries_to_csv(entries) ic = Iconv.new(l(:general_csv_encoding), 'UTF-8') + decimal_separator = l(:general_csv_decimal_separator) export = StringIO.new CSV::Writer.generate(export, l(:general_csv_separator)) do |csv| # csv header fields @@ -67,7 +68,7 @@ module TimelogHelper (entry.issue ? entry.issue.id : nil), (entry.issue ? entry.issue.tracker : nil), (entry.issue ? entry.issue.subject : nil), - entry.hours, + entry.hours.to_s.gsub('.', decimal_separator), entry.comments ] csv << fields.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end } |