The default decimal separator depends on the locale used. You can set it in 2 ways:
-
On a per-view basis by the
locale
attribute of the<f:view>
tag:<f:view locale="#{bean.locale}">
-
On a per-converter basis by the
locale
attribute of the<f:convertNumber>
tag:<f:convertNumber locale="#{bean.locale}" />
It’s unclear what locale you’re targeting, but the use of .
as fraction separator is typical for US dollars with a locale of en-US
, for example. So you need to set it as such:
<f:convertNumber type="currency" currencySymbol="$" locale="en-US" />
It can also be obtained from a java.util.Locale
bean property.
<f:convertNumber type="currency" currencySymbol="$" locale="#{bean.locale}" />
Note that I used type="currency"
, that’s more self-documenting.
See also:
- Does <f:convertNumber> use the right number separator when using patterns to format currency?
- Localization in JSF, how to remember selected locale per session instead of per request/view