You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Christopher Schultz (JIRA)" <ji...@apache.org> on 2013/01/20 16:42:12 UTC

[jira] [Commented] (STR-3218) Numeric field validators are not localized

    [ https://issues.apache.org/jira/browse/STR-3218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13558282#comment-13558282 ] 

Christopher Schultz commented on STR-3218:
------------------------------------------

Actually, it seems that validateDouble, validateFloat, etc. were not meant to be internationalized: I hadn't noticed the validateDoubleLocale, validateFloatLocale, etc. methods.

The validate[Type]Range methods, however, will fail when coupled with validate[Type]Locale and the user's locale is different from the default locale.
                
> Numeric field validators are not localized
> ------------------------------------------
>
>                 Key: STR-3218
>                 URL: https://issues.apache.org/jira/browse/STR-3218
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.10
>            Reporter: Christopher Schultz
>
> See recent users' list discussion: http://markmail.org/thread/3sh5cqncwvpph3vr
> The following o.a.s.validator.FieldChecks methods do not use the user's Locale when calling commons-validator's available methods for parsing floating-point values:
> validateDouble
> validateDoubleRange
> validateFloat
> validateFloatRange
> validateInteger
> validateIntegerRange
> validateLong
> validateLongRange
> validateShort
> validateShortRange
> For the integral data types, this isn't such a bug deal because thousands separators are optional (like "1,000" in en-US locale for "one thousand). However, for decimal types, the decimal separator is required and when my default locale is en-US I cannot successfully validate a decimal formatted for, say, Spanish locale (e.g. "1,50" for "one and a half").

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira