[
https://issues.apache.org/struts/browse/WW-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46503#action_46503
]
Bernard FRANCIS edited comment on WW-2349 at 7/24/09 5:31 AM:
--------------------------------------------------------------
Hello,
About formating, we tried this using the 2.1.7 of struts and it works fine,
all numbers get formatted using the locale as expected
But we have a special need here : while content are internationalized according
to the locale, we would like the number to be formatted always the same way (ie
en_US format ',' for thousands and '.' for decimals) no matter what the current
language is.
If we remove the getText(... formating as described in the documentation
(http://cwiki.apache.org/confluence/display/WW/Formatting+Dates+and+Numbers)
there is no conversion issues with numbers, but they're not formated.
When we put the formating, and swith, say, to fr locale, the keyed in numbers
by the users (using the en_US format) will be considered invalid (as fr locale
don't accept '.' for parsing)
How can we tell the converter to always parse with the en_US Locale ?
was (Author: augrhlp):
Hello,
About formating, we tried this using the 2.1.7 of struts and it works fine,
all numbers get formatted using the locale as expected
But we have a special need here : while content are internationalized according
to the locale, we would like the number to be formatted always the same way (ie
en_US format ',' for thousands and '.' for decimals) no matter what the current
language is.
If we remove the getText(... formating as described in the documentation
(http://cwiki.apache.org/confluence/display/WW/Formatting+Dates+and+Numbers)
there is no conversion issues with numbers, but they're not formated.
When we put the formating, and swith, say, to fr locale, the keyed in numbers
by the users (using the en_US format) will be considered invalid (as fr locale
don't accept '.' for parsing)
How can we tell the converter to always parse with the en Locale ?
> localized conversion from number to string broken
> -------------------------------------------------
>
> Key: WW-2349
> URL: https://issues.apache.org/struts/browse/WW-2349
> Project: Struts 2
> Issue Type: Bug
> Components: Documentation
> Affects Versions: 2.0.11
> Reporter: Sebastian
> Assignee: Rene Gielen
> Fix For: 2.1.1
>
>
> Situation:
> Locale is set to de_DE.
> Action contains a property
> private Double percentage;
> with getters/setters. The corresponding page contains a "textfield" tag for
> this property. It only accepts a "," (comma) as a decimal separator due to
> the set locale.
> But when the Double property is preset to a certain value and the page
> rendered afterwards, the textfield is filled with a number using the "."
> (dot) as decimal separator, instead of comma.
> In short: parsing of numbers is localized, formatting not. This is
> inconsistent.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.