amachado
amachado

Reputation: 1040

How to get currency symbol in JSP for specifc locale

I'm wordering how to display just the currency symbol for a specifc locale and currency code (3 letters code: for example GBP) in jsp/html.

For example, with currency code GBP and locale en-GB it will displays £ (but the locale can change).

Thanks

Upvotes: 0

Views: 1300

Answers (2)

ceckleder
ceckleder

Reputation: 26

Yes the answer from Avinash will also render the value. If you just want to render the symbol, there are two possibilities: 1.) HTML £ (more on currency symbols) 2.) Store the symbol in the message.property file and add it with to the jsp.

Upvotes: 1

Avinash Babu
Avinash Babu

Reputation: 6252

You could use the currencySymbol attribute and set the value.

THE code would be like

<fmt:formatNumber value="${amount}" type="currency" currencySymbol="FOO" currencyCode="${currencyCode}" var="amt" />

as mentioned here.

Have a look here too

Upvotes: 0

Related Questions