Defect #42233
closedFloat custom values with ',' as decimal separator are not converted to '.' and cause SQL errors when sorting or summing
0%
Description
If using german language settings redmine shows value 1.5 as 1,5.
You can put 1,5 to a numeric field. Redmine shows this a 1,0 on overview.
In tables, if you sort a field with this value you get error 500.
If you want a sum over this field you get error 500, too.
With english language settings it's not possible to put 1,5 to a numeric field.
Files
Related issues
Updated by Go MAEDA 15 days ago
- Related to Feature #39997: Add an option to render values of Integer- and Float-format custom fields with thousands delimiters added
Updated by Go MAEDA 15 days ago
- Related to Feature #22024: Support localized decimal separators for float values added
Updated by Go MAEDA 15 days ago
- Related to deleted (Feature #39997: Add an option to render values of Integer- and Float-format custom fields with thousands delimiters)
Updated by Go MAEDA 15 days ago
- File 42233.patch 42233.patch added
- Status changed from New to Confirmed
- Target version set to Candidate for next minor release
Thank you for reporting this issue. The problem occurs because, when using German language settings, Redmine allows the input of 1,5
(with a comma as the decimal separator) into numeric fields. However, this value is not properly converted to 1.5
(with a period as the decimal separator) before being saved in the custom_values
table. As a result, the value remains as 1,5
in the database, causing errors during sorting or summation.
I have wroate a patch to address this issue. Once applied, the patch ensures that any new input like 1,5
is correctly converted to 1.5
before being saved to the database. However, please note that this patch does not automatically fix existing data that has already been saved with a comma as the decimal separator.
To correct existing data, you can do one of the following:
1. Open the issue edit page, manually change the decimal separator from `,` to `.` in the custom field value, and save the issue.
2. Apply the patch, then open the issue edit page and save it without making any changes. This will update the value to use a period as the decimal separator.
Updated by Go MAEDA 15 days ago
- Subject changed from Query::StatementInvalid: PG::InvalidTextRepresentation: ERROR: invalid input syntax for type numeric: ",5" to Float custom values with ',' as decimal separator are not converted to '.' and cause SQL errors when sorting or summing
- Category set to Custom fields
- Target version changed from Candidate for next minor release to 6.0.4
Setting the target version to 6.0.4.
Updated by Grischa Zengel 15 days ago
I patched my Redmine and it's working. Thanks for it.
It's different to time entries. If I edit an existing time entry it will show me a comma in the hours field.
I can put point or comma and it shows everywhere a comma.
For user fields I can put comma or point. It shows me everywhere a comma except if I edit this field, it will show me a point.
Updated by Go MAEDA 14 days ago
Grischa Zengel wrote in #note-6:
I patched my Redmine and it's working. Thanks for it.
Thank you for your feedback.
It's different to time entries. If I edit an existing time entry it will show me a comma in the hours field.
I can put point or comma and it shows everywhere a comma.For user fields I can put comma or point. It shows me everywhere a comma except if I edit this field, it will show me a point.
I will handle this in a new issue.