Project

General

Profile

Actions

Defect #10364

closed

Custom field float separator in CSV export

Added by Michael Kling almost 13 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Category:
I18n
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

We are using custom fields in the time entries of type float.

Using german language we noticed that the decimal separator in csv exports are not changed! (Also not for the time itself but i could solve that with #8368.

For the custom fields i could fix it in this way:

In /lib/redmine/custom_field_format.rb find this (Around line 47)

    ['string','text','int','float','list'].each do |name|
      define_method("format_as_#{name}") {|value|
        return value
      }
    end

and replace it with:
    def format_as_float(value)
     decimal_separator = l(:general_csv_decimal_separator)
     return ("%.2f" % value).gsub('.',decimal_separator)
    end

    def format_as_int(value) 
     decimal_separator = l(:general_csv_decimal_separator)
     return ("%.2f" % value).gsub('.',decimal_separator)
    end

    ['string','text','list'].each do |name|
      define_method("format_as_#{name}") {|value|
        return value
      }
    end

It's working but i don't know if this was the right place.

Actions #1

Updated by Etienne Massip almost 13 years ago

  • Status changed from New to Confirmed
  • Target version set to Candidate for next minor release
  • Affected version (unused) changed from 1.2.0 to 1.3.1
  • Affected version changed from 1.2.0 to 1.3.1
Actions #2

Updated by Michael Kling almost 13 years ago

Just realize that it doesnt make sense for integer...

Actions #3

Updated by Jean-Philippe Lang almost 12 years ago

  • Subject changed from Custom Field Float Separator in CSV Export to Custom field float separator in CSV export
  • Status changed from Confirmed to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version changed from Candidate for next minor release to 2.3.0
  • Resolution set to Fixed

Fixed in r11441.

Actions

Also available in: Atom PDF