Your pattern
is wrong for a currency. You should be using pattern="¤#,##0.00"
.
<f:convertNumber pattern="¤#,##0.00" currencySymbol="$" />
However, there's more at matter: in your original code you also specified the type
attribute, which is correct, but this is mutually exclusive with the pattern
attribute whereby the pattern
attribute gets precedence.
You should actually be omitting the pattern
attribute and stick to the type
attribute.
<f:convertNumber type="currency" currencySymbol="$" />
Note that this uses the locale as available by UIViewRoot#getLocale()
which is expected to be an English/US based locale in order to get the right final format for the USD currency. You'd like to explicitly specify it in either the <f:view>
:
<f:view locale="en_US">
or in the locale
attribute of the <f:convertNumber>
:
<f:convertNumber type="currency" currencySymbol="$" locale="en_US" />
See also: