How can I display different currencies in my JSP pages according to the location of the client.

Byron Tymvios

You can do this by using the Locale of the user (which can be obtained from request.getLocale() and passing it to a NumberFormat object. You can then format your number and it will automagically have the correct currency sign preceeding the value.

// The number to display
double val = 12345d;

Locale locale = request.getLocale();
String toDisplay = NumberFormat.getCurrencyInstance(locale).format(val);