Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Currency localization

Status
Not open for further replies.

siberian

Programmer
Sep 27, 2003
1,295
US
I am getting the following error when attempting to use a currency type in my ApplicationResources.properties file

Code:
root cause

java.lang.IllegalArgumentException: unknown format type at 
	at java.text.MessageFormat.makeFormat(MessageFormat.java:1426)
	at java.text.MessageFormat.applyPattern(MessageFormat.java:447)
	at java.text.MessageFormat.(MessageFormat.java:347)
	at org.apache.struts.util.MessageResources.getMessage(MessageResources.java:346)
	at org.apache.struts.util.RequestUtils.message(RequestUtils.java:1051)
..
..

I can format the currency via locale within my class and then pass it out but I would rather let struts and messageresources handle it.

Here is the line in ApplicationResources.properties:

Code:
global.displaybudgetstatus={0,currency} spent since {1}

and here is the line in my jsp file

Code:
<bean:message key="global.displaybudgetstatus" arg0="<%=Double.toString(printeritem.getCurrentbudget())%>" arg1="<%=printeritem.getBudgetresetdate()%>"/>

Anyone have any ideas? The error tells me that it does not understand the format, am I misusing the format specifier in appresources?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top