It's not a secret anymore!*
The moose likes Struts and the fly likes currency format key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "currency format key" Watch "currency format key" New topic
Author

currency format key

Ricardo Estafan
Ranch Hand

Joined: Mar 29, 2004
Posts: 84
Hello all,

i have the following format for the currency :

###.###,00

This however results in the following exception :

javax.servlet.jsp.JspException: Wrong format string: '###.###,00'
at org.apache.struts.taglib.bean.WriteTag.formatValue(WriteTag.java:345)
at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:234)

Could someone please explain how i can make a format that will result in :

1.234,00 ?!

Ok i found out it has to do with the locale. When locale is nl it works, when locale is en_US is throws the exception. How can i make sure no matter what the locale is this format pattern works, without me having to declare a lot of format patterns?!

Thanks!!
[ April 21, 2005: Message edited by: Ricardo Estafan ]
 
 
subject: currency format key
 
Similar Threads
how to format numbers with Local Currency
SEVERE: BAD packet signature 200,SEVERE: Caught exception (java.lang.NullPointerException)
I18N Currency Formatting Issue
How to format a number using country's currency
how to use locale in javascript