Formatting numbers with MessageResources

Hi,

I'm developing a webapp using Struts 1.3. I've seen that is possible to do this:

<bean:message key="label.myNumber" arg0="${myBean.value}"/>

And then, in MessageResources.properties

label.myNumber = My number is:{0,number,##0.00'%'}

However, when I try to execute it, i get the following error:

10:15:20,296-ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/TFC].[jsp] -Servlet.service() for servlet jsp threw exception

java.lang.IllegalArgumentException: Cannot format given Object as a Number

at java.text.DecimalFormat.format(Unknown Source)

at java.text.Format.format(Unknown Source)

at java.text.MessageFormat.subformat(Unknown Source)

at java.text.MessageFormat.format(Unknown Source)

at java.text.Format.format(Unknown Source)

at org.apache.struts.util.MessageResources.getMessage(MessageResources.java:308)

at org.apache.struts.taglib.TagUtils.message(TagUtils.java:953)

at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:221)

at org.apache.jsp.pages.topicsContent_jsp._jspx_meth_bean_message_5(topicsContent_jsp.java:735)

at org.apache.jsp.pages.topicsContent_jsp._jspService(topicsContent_jsp.java:191)

...

Does anybody knows what's wrong?

[1454 byte] By [xurigueraa] at [2007-11-27 9:37:43]
# 1
What does myBean.getValue() method get you?A number? A String?
evnafetsa at 2007-7-12 23:09:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
A Double
xurigueraa at 2007-7-12 23:09:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
It's supposed to be like this, isn't it?
xurigueraa at 2007-7-12 23:09:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...