struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Pratt <thechrispr...@gmail.com>
Subject Re: Currency Formatting
Date Tue, 13 Jul 2010 19:16:42 GMT
try <s:param> instead of <s:property>.
  (*Chris*)

On Tue, Jul 13, 2010 at 12:11 PM, Chris Miles <chris@chrismiles.org> wrote:

> At the moment I have in my struts.xml
>
> <constant name="struts.custom.i18n.resources" value="ApplicationResources"
> />
>
> ApplicationResources.properties is being packaged within WEB-INF\classes
> within a WAR within an EAR.
>
> The file contains: format.currency={0,number,currency}
>
> In my JSP I have <s:text name="format.currency"><s:property
> value="product.price"/></s:text>
>
> Without the s:text the price is displayed (a Double).
>
> When the s:text is included all I get is: {0}
>
> thanks
>
> Chris
> ----- Original Message ----- From: "Chris Pratt" <thechrispratt@gmail.com>
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Sent: Sunday, July 11, 2010 1:25 AM
> Subject: Re: Currency Formatting
>
>
>
>  Define something like:
>>
>> format.currency={0,number,currency}
>>
>> In your applications.properties file, then use:
>>
>> <s:text name="format.currency"><s:param value="%{amount}"/></s:text>
>>
>> HTH
>>  (*Chris*)
>>
>> On Sat, Jul 10, 2010 at 5:53 AM, Chris Miles <chris@chrismiles.org>
>> wrote:
>>
>>  Hi
>>>
>>> If I am displaying a Double to a JSP page what is the recommended way to
>>> format this is as a currency to two decimal points?
>>>
>>> Thanks
>>>
>>> Chris
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message