This content has been marked as final. Show 4 replies
The format mask "#.##0,###" is not correct (because it specifies a grouping separator at a location after the decimal point). In Java format masks the symbol "." always refers to a decimal point (e.g. to its position but not to the actual symbol) and the character "," always refers to a grouping separator. The actual symbols (for a decimal point and a grouping separator) that are used when formatting a numeric value and/or parsing numeric literal, depend on the locale. Alternatively, the actual symbols can be overridden using the method DecimalFormat.setDecimalFormatSymbols(...).
If you want to parse/format your numbers such as the decimal point is parsed/formatted as a comma (",") and grouping separator as a dot ("."), then use the format mask "#,###0.###" and set a proper locale (either in <af:convertNumber locale="..."> or for the whole JSF page in <f:view locale="...">) which specifies the decimal point as a comma and the grouping separator as a dot. An example for such a locale is the Locale( "it", "IT" ).
Thanks for your answer. The problem is how to choose/set the correct Locale then. Suppose I want the page in en_EN but still want the couple ".", "," as separators in the numbers as if they were in the it_IT locale, Would this be possible in some way (without modifying the trinidad-config.xml)? Basically how can I override the actual symbols? I must miss something. I know what setDecimalFormatSymbols does, but how can that modify what the af:convertNumber finally shows? I would really appreciate a simple example.
Edited by: user10047839 on Jan 22, 2013 10:44 AM