I am using JSF’s 2.0 standard convertor tags to format some number output as currency.
But i have a little problem, I dont know how to place the euro symbol at the end of the output.
This is what I did:
<h:outputText value="#{payment.amount}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
The output I get is:
€15.55
But the desired output is:
15,55€
Can someone give me advice on how to solve this little issue?
The format is dependent on the locale of the view. The locale can be set in 2 ways.
Generically by the
localeattribute of the<f:view>tag:Specifically by the
localeattribute of the<f:convertNumber>tag:It’s unclear what locale you’re targeting, but the use of
,as fraction separator and the placement of€after the currency is typical for among others Germany (de-DE), France (fr-FR) and Portugal (pt-PT). So you need to set it as such:It can also be obtained from a
java.util.Localebean property.