Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 90300 invoked from network); 14 Jul 2010 07:55:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Jul 2010 07:55:16 -0000 Received: (qmail 21177 invoked by uid 500); 14 Jul 2010 07:55:14 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 20932 invoked by uid 500); 14 Jul 2010 07:55:11 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 20924 invoked by uid 99); 14 Jul 2010 07:55:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jul 2010 07:55:10 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [193.109.255.147] (HELO mail72.messagelabs.com) (193.109.255.147) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 14 Jul 2010 07:55:02 +0000 X-VirusChecked: Checked X-Env-Sender: James.Cook@wecomm.com X-Msg-Ref: server-8.tower-72.messagelabs.com!1279094082!2765225!1 X-StarScan-Version: 6.2.4; banners=-,-,- X-Originating-IP: [62.244.190.146] Received: (qmail 18574 invoked from network); 14 Jul 2010 07:54:42 -0000 Received: from 62-244-190-146.cust.exponential-e.net (HELO lonex01.weComm.local) (62.244.190.146) by server-8.tower-72.messagelabs.com with SMTP; 14 Jul 2010 07:54:42 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Currency Formatting Date: Wed, 14 Jul 2010 08:54:40 +0100 Message-ID: <4FDDA327A6C64D4BB6B4670122AA8D420242BFFD@lonex01.weComm.local> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Currency Formatting Thread-Index: Acsi2sWG80uL1CX0ROqr857yw00ASQATsfHg References: <000601cb202e$f69622d0$0400a8c0@OBIWAN><002701cb22bf$2cff2e10$0400a8c0@OBIWAN><004a01cb22d4$632c7460$0400a8c0@OBIWAN><005e01cb22da$0af3b5f0$0400a8c0@OBIWAN> From: "James Cook" To: "Struts Users Mailing List" X-Virus-Checked: Checked by ClamAV on apache.org Ooo, didn't know I could use an iterator like that, I have always defined the var. Thanks for the tip, however do you not find that other way easier for readability? Just thinking an outsider might be left wondering where "price" came from.. Maybe I am missing the point. -----Original Message----- From: Chris Pratt [mailto:thechrispratt@gmail.com]=20 Sent: 13 July 2010 23:28 To: Struts Users Mailing List Subject: Re: Currency Formatting I've never used the iterator tag like that, the standard way to use the Struts 2 Iterator would be: "/> £ Since the iterator tag puts the current value on the top of the stack, there's no reason to define a variable to hold it. It's much simpler to just use the value stack to pull the values from. Don't know if this might help or not. (*Chris*) On Tue, Jul 13, 2010 at 3:23 PM, Chris Miles wrote: > Chris, > > I have a list of products which contain a double price. > > I now have. > > > > £ name=3D"format.currency"> > > > > Chris > ----- Original Message ----- From: "Chris Pratt" > To: "Struts Users Mailing List" > Sent: Tuesday, July 13, 2010 11:04 PM > > Subject: Re: Currency Formatting > > > puts the value on the top of the stack, so if you have a list >> of doubles, we'll call it amounts, it would look something like this: >> >> >> >> >> >> (*Chris*) >> >> On Tue, Jul 13, 2010 at 2:43 PM, Chris Miles >> wrote: >> >> Chris, >>> >>> Hi that works perfectly for >>> >>> >>> >>> where total is public Double getTotal >>> >>> but causes all rendering to stop at the following within an iterator. >>> >>> >>> >>> where List getProducts (for the iterator), public Product >>> getProduct and public Double getPrice >>> >>> and also fails just on >>> >>> >>> >>> where public Product getProduct >>> >>> Is there places where different mechanisms need to be used here? I dont >>> understand the inconstistant result I now get. >>> >>> Nothing in the log files on TRACE >>> >>> >>> Thanks >>> >>> Chris >>> ----- Original Message ----- From: "Chris Pratt" < >>> thechrispratt@gmail.com> >>> To: "Struts Users Mailing List" >>> Sent: Tuesday, July 13, 2010 8:16 PM >>> Subject: Re: Currency Formatting >>> >>> >>> >>> try instead of . >>> >>>> (*Chris*) >>>> >>>> On Tue, Jul 13, 2010 at 12:11 PM, Chris Miles >>>> wrote: >>>> >>>> At the moment I have in my struts.xml >>>> >>>>> >>>>> >>>> value=3D"ApplicationResources" >>>>> /> >>>>> >>>>> ApplicationResources.properties is being packaged within >>>>> WEB-INF\classes >>>>> within a WAR within an EAR. >>>>> >>>>> The file contains: format.currency=3D{0,number,currency} >>>>> >>>>> In my JSP I have >>>> value=3D"product.price"/> >>>>> >>>>> 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" >>>>> Sent: Sunday, July 11, 2010 1:25 AM >>>>> Subject: Re: Currency Formatting >>>>> >>>>> >>>>> >>>>> Define something like: >>>>> >>>>> >>>>>> format.currency=3D{0,number,currency} >>>>>> >>>>>> In your applications.properties file, then use: >>>>>> >>>>>> >>>>>> >>>>>> HTH >>>>>> (*Chris*) >>>>>> >>>>>> On Sat, Jul 10, 2010 at 5:53 AM, Chris Miles >>>>>> 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 >>>>> >>>>> >>>>> >>>>> >>>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >>> For additional commands, e-mail: user-help@struts.apache.org >>> >>> >>> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org