From 1ab44859feac685719b1f8f4023fec6f89b78e08 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 4 Jan 2024 06:55:14 +0000 Subject: Support localized decimal separators for float values (#22024). Patch by Liane Hampe (@liane_hampe). git-svn-id: https://svn.redmine.org/redmine/trunk@22592 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/field_format.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/redmine/field_format.rb') diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb index a27311141..5e81055f1 100644 --- a/lib/redmine/field_format.rb +++ b/lib/redmine/field_format.rb @@ -539,8 +539,9 @@ module Redmine end def validate_single_value(custom_field, value, customized=nil) + value = normalize_float(value) errs = super - errs << ::I18n.t('activerecord.errors.messages.invalid') unless (Kernel.Float(value) rescue nil) + errs << ::I18n.t('activerecord.errors.messages.invalid') unless Kernel.Float(value, exception: false) errs end -- cgit v1.2.3