Return-Path: Delivered-To: apmail-jakarta-tapestry-user-archive@www.apache.org Received: (qmail 95095 invoked from network); 1 Sep 2005 21:42:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Sep 2005 21:42:03 -0000 Received: (qmail 61007 invoked by uid 500); 1 Sep 2005 21:41:58 -0000 Delivered-To: apmail-jakarta-tapestry-user-archive@jakarta.apache.org Received: (qmail 60992 invoked by uid 500); 1 Sep 2005 21:41:58 -0000 Mailing-List: contact tapestry-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Tapestry users" Reply-To: "Tapestry users" Delivered-To: mailing list tapestry-user@jakarta.apache.org Received: (qmail 60979 invoked by uid 99); 1 Sep 2005 21:41:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2005 14:41:58 -0700 X-ASF-Spam-Status: No, hits=1.7 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of patcasey@adelphia.net designates 68.168.78.202 as permitted sender) Received: from [68.168.78.202] (HELO mta10.adelphia.net) (68.168.78.202) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2005 14:42:12 -0700 Received: from PCASEY ([67.23.34.52]) by mta10.adelphia.net (InterMail vM.6.01.04.01 201-2131-118-101-20041129) with ESMTP id <20050901214155.FAZH12165.mta10.adelphia.net@PCASEY> for ; Thu, 1 Sep 2005 17:41:55 -0400 From: "Patrick Casey" To: "'Tapestry users'" Subject: RE: Decimal rounding problems when working with currency. Date: Thu, 1 Sep 2005 14:41:46 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Thread-Index: AcWvPbVUAMCvLGCDQbORRoCIHO0K2gAAC22Q In-Reply-To: <55a67ba30509011439310e4fcc@mail.gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-Id: <20050901214155.FAZH12165.mta10.adelphia.net@PCASEY> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N You could make it a ValidField and then write your own BigDecimal validator to do the translation to and from strings, couldn't you? --- Pat > -----Original Message----- > From: Ted Steen [mailto:ted.steen@gmail.com] > Sent: Thursday, September 01, 2005 2:40 PM > To: Tapestry users > Subject: Decimal rounding problems when working with currency. > > Hi all! > > I need to work with BigDecimal in order to represent decimal numbers > with greater precision than float. > > If I need to store the (float) number 27.9 in a BigDecimal it > transforms into 27.89999999999999857891452847... > > In tapestry I have my @TextField with translator:number > tied to a property "public abstract BigDecimal getAmount();" > problem is that tapestry seem to store 27.9 in a float (or maybe > double) before storing it in the BigDecimal which mess up the number. > :( > > Now are there a translator for BigDecimal, should I write my own > translator or should I re-thing the whole thing? > > > -- > /ted > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tapestry-user-help@jakarta.apache.org