Feature #39997
closed
Add an option to render values of Integer- and Float-format custom fields with thousands delimiters
Added by Mischa The Evil 12 months ago.
Updated 5 months ago.
Description
This is extracted from #22024:
Mischa The Evil wrote in #22024#note-10:
Go MAEDA wrote in #22024#note-6:
The patch by Liane Hampe also adds the ability to display thousand delimiters. However, I think displaying thousand delimiters should be out of the scope of this patch. This is because not all users may agree with always displaying the thousand delimiter. Additionally, at this time, entering a value with a thousand delimiter into a custom field results in a validation error. In my opinion, the feature to display thousand delimiters should be discussed in another issue.
A separate, additional feature providing a custom field option (using field_attributes
?) to display thousand delimiters for selected Float
(but also Integer
) custom fields could be nice to have in some cases when dealing with larger values, [...]
However, I think that Redmine doesn't need to provide support for entering values with thousands delimiters into a custom field. It feels like overkill to me.
Files
- Related to Feature #22024: Support localized decimal separators for float values added
I started to write a patch for this feature.
Heres are patches to implement this feature:
- attachment:0001-Refactor-ApplicationHelper-format_object-to-support-.patch refactors ApplicationHelper#format_object to accept
:html
option as a keyword argument. This change is a prerequisite for adding the new :thousands_delimiter
option in the third patch.
- 0002-Updated-number.format.delimiter-values-in-locale-fil.patch updates `number.format.delimiter` values in
config/locales/*.yml
files according to rails-i18n's rails/locales/*.yml
files to correctly display thousands separators. But I didn't change locales where number.format.separator
values differ between Redmine and rails-i18n
- 0003-Add-option-to-render-Integer-and-Float-custom-fields.patch implements the option to render Integer and Float custom fields with thousands delimiters.
- File deleted (
0003-Add-option-to-render-Integer-and-Float-custom-fields.patch)
- Target version changed from Candidate for next major release to 6.0.0
Setting the target version to 6.0.0.
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patches in r22933, r22934, and r22935.
- Now integer and float custom fields have a "Thousands delimiter" option
- Values are rendered with thousands delimiters when the option is enabled
Also available in: Atom
PDF