struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <>
Subject Re: Moving from bean:write to fmt:formatNumber
Date Tue, 04 May 2004 18:04:01 GMT
There are (at least) a couple options. One would be to create a property like:


And then use <fmt:message>:

<fmt:message key="numberFormat">
  <fmt:param value="${aNumber}"/>

Another would be to leverage the fact that the pattern attribute of
<fmt:formatNumber> accepts an EL expression. So, you'd load the pattern and
then do:

<fmt:formatNumber value="${aNumber}" pattern="${numberPattern}"/>

There are all kinds of ways you could load the pattern, but one would be:

<fmt:message key="numberPattern" var="numberPattern"/>

Quoting Earl Woodman <>:

> Hi,
> I'm trying to move from bean:writes to fmt:formatNumber in my application,
> but I'm finding that in order to format a number, I can't get a formatting
> pattern from my application resources file - there doesn't seem to be a key
> parameter in the fmt:formatNumber tag. Has anyone run into this problem in
> the past and what have you done about it?
> Thanks a lot,
> Earl
> Earl Woodman
> Software Developer
> Verafin Inc

Kris Schneider <>
D.O.Tech       <>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message