Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 21550 invoked from network); 1 May 2009 18:27:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 May 2009 18:27:23 -0000 Received: (qmail 48044 invoked by uid 500); 1 May 2009 18:27:19 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 48003 invoked by uid 500); 1 May 2009 18:27:19 -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 47993 invoked by uid 99); 1 May 2009 18:27:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 18:27:19 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of burtonrhodes@gmail.com designates 74.125.46.31 as permitted sender) Received: from [74.125.46.31] (HELO yw-out-2324.google.com) (74.125.46.31) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 18:27:11 +0000 Received: by yw-out-2324.google.com with SMTP id 2so1396105ywt.17 for ; Fri, 01 May 2009 11:26:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=7CLRwdOXsN/+r/K46mXTvKGP4pk5S+kfb7imGBJWykM=; b=iPr87B2vf3G5N1gGCdGuUMryWzQpqJnkzAQJ/oz8jol1USFsp7iLf5SV5K0gMyC47D bNwiDaqXWNdStYPP/6qFiwhCXjdev06ZuKDl0P34gdh6Xp7ePKIyBy4NHVhZo2UcAFSB Q/OlCM68Th+soFZ6cqjltkcdx3lb1OTiHjaho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=CNOaa/KzhSP2v0caA/Cqe7P3R69tjpi/ovN1m/Rni+3kzrQLVyxq8Bp+KI4ecMZLvd tyopN62d0aQDhx/26v/yhkQHiMMToXbovQKyHX/Z63GyHHmAU4feBrkgawVB+4fGFz/a oMIKbCtxTV9+Zk7cmX9dwKljclpZQ64PvDUR4= MIME-Version: 1.0 Received: by 10.151.124.6 with SMTP id b6mr5991389ybn.160.1241202410669; Fri, 01 May 2009 11:26:50 -0700 (PDT) In-Reply-To: <23336400.post@talk.nabble.com> References: <23336400.post@talk.nabble.com> Date: Fri, 1 May 2009 13:26:50 -0500 Message-ID: <3017fd9e0905011126n61e7ad7dhea5dd736d2ea4f36@mail.gmail.com> Subject: Re: number formatting (with commas) From: Burton Rhodes To: Struts Users Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I solved it this way: Then in your class path put a file called package.properties with the follo= wing: # used to format dates, numbers in the jsp files (display) format.time =3D {0,time} format.dateShort =3D {0,date,MM/dd/yyyy} format.number =3D {0,number,###,##0.0##} format.percent =3D {0,number,##0.00'%'} format.money =3D {0,number,\u00A4###,##0} format.moneyDecimal =3D {0,number,\u00A4###,##0.00} On Fri, May 1, 2009 at 12:01 PM, akoo wrote: > > Hi guys, > I have looked through all of the documentations and am just not having an= y > success formatting numbers (i.e 70333 -> 70,333) =A0so I thought i'd ask = you > guys. =A0here are relevant snippets of my code. > > =A0 > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 value=3D"netpl"> > > > Positions in the above code is a list of position objects > class Position > { > =A0 =A0private String symbol; > =A0 =A0private String account; > =A0 =A0private float netpl; > =A0 =A0//followed by getters and setters for all of the above field > } > > The Action class FirmwidePositionAction =A0returns the list of positions = after > querying the the database > > What I want is for the netpl number to show up formatted properly with th= e > comma placeholders and a 'USD' prefix, =A0so I created the package.proper= ties > file and placed it in the same package as the action class. > Here is my package.properties file > > format.time =3D {0,time} > format.number =3D USD{0,number,##0.00} > format.percent =3D {0,number,##0.00'%'} > format.money =3D {0,number,\u00A4##0.00} > > > The numbers all show up perfectly. However, I am not able to get the 'USD= ' > to appear in front of the netpl columns. =A0What am I doing wrong here? > > Thanks > > -- > View this message in context: http://www.nabble.com/number-formatting-%28= with-commas%29-tp23336400p23336400.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > 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