プロジェクト

全般

プロフィール

Vote #71450

完了

Custom field float separator in CSV export

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
I18n_37
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
37
version_id:
60
issue_org_id:
10364
author_id:
33413
assigned_to_id:
1
comments:
3
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
41
ステータス-->[Closed]

説明

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.


journals

--------------------------------------------------------------------------------
Just realize that it doesnt make sense for integer...
--------------------------------------------------------------------------------
Fixed in r11441.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリI18n_37 にセット
  • 対象バージョン2.3.0_60 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0