From adffaces-dev-return-1882-apmail-incubator-adffaces-dev-archive=incubator.apache.org@incubator.apache.org Mon Dec 18 19:29:15 2006 Return-Path: Delivered-To: apmail-incubator-adffaces-dev-archive@locus.apache.org Received: (qmail 83289 invoked from network); 18 Dec 2006 19:29:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Dec 2006 19:29:15 -0000 Received: (qmail 55200 invoked by uid 500); 18 Dec 2006 19:29:22 -0000 Delivered-To: apmail-incubator-adffaces-dev-archive@incubator.apache.org Received: (qmail 55185 invoked by uid 500); 18 Dec 2006 19:29:22 -0000 Mailing-List: contact adffaces-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-dev@incubator.apache.org Delivered-To: mailing list adffaces-dev@incubator.apache.org Received: (qmail 55176 invoked by uid 99); 18 Dec 2006 19:29:22 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Dec 2006 11:29:22 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of mkienenb@gmail.com designates 64.233.184.237 as permitted sender) Received: from [64.233.184.237] (HELO wr-out-0506.google.com) (64.233.184.237) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Dec 2006 11:29:12 -0800 Received: by wr-out-0506.google.com with SMTP id i32so590910wra for ; Mon, 18 Dec 2006 11:28:52 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=L2ufGXmyPm5Zt0a+6SvV4mlqeRXX71+xHk+kTNr3zXzaiTb7z32c7quGDHLA+iGbocapS+/WVSLPh4PPA1bosnq+kIIV2PXo1zT9w2joGASCXndToUsclI/cCwLfAmYqzqrrBzpMiZcZ6ZP3YP8xhDRooOocrOHRpQy5rRQIy5Y= Received: by 10.78.166.7 with SMTP id o7mr2655252hue.1166470130085; Mon, 18 Dec 2006 11:28:50 -0800 (PST) Received: by 10.78.197.6 with HTTP; Mon, 18 Dec 2006 11:28:49 -0800 (PST) Message-ID: <8f985b960612181128r76efc013hd15e29600b70bb6b@mail.gmail.com> Date: Mon, 18 Dec 2006 14:28:49 -0500 From: "Mike Kienenberger" To: adffaces-dev@incubator.apache.org Subject: Re: tr:convertNumber, type="currency", and BigDecimal In-Reply-To: <7F48470F8BE0AC488F0000539350728901D97CA5@zeus.chordiant.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8f985b960612180809x394c796el758968f394369f89@mail.gmail.com> <7F48470F8BE0AC488F0000539350728901D97CA5@zeus.chordiant.com> X-Virus-Checked: Checked by ClamAV on apache.org Well, I can't speak for the trinidad version of the component, but all of this needs to be taken care of during conversion, and the default f:convertNumber component only converts to Long or Double, not any other type. That's why we created a tomahawk:convertNumber component that was more flexible. On 12/18/06, David Brunette wrote: > > Thanks for the reply. > > Unless I'm mistaken, the piece of code that I am looking to update > is called AFTER all the conversion is done. I am simply trying to take > the already converted value and allow it to be put into a target with > type BigDecimal. Hopefully all of the stuff that you have mentioned is > already taken care of by the NumberConverter class. > > Dave > > -----Original Message----- > From: Mike Kienenberger [mailto:mkienenb@gmail.com] > Sent: Monday, December 18, 2006 11:09 AM > To: adffaces-dev@incubator.apache.org > Subject: Re: tr:convertNumber, type="currency", and BigDecimal > > There are a couple of issues with a currency/bigdecimal converter. > > - You have to strip out (or add in -- I can't remember) the currency > symbol before parsing the currency value > > - You have to handle a parsing bug in DecimalFormat > > You can find code to do both of these things here: > > http://issues.apache.org/jira/browse/TOMAHAWK-610 > > You might also want to take a look at the Tomahawk sandbox > convertNumber converter. It doesn't yet include the two bug fixes > above, but it provides a generic solution for converting numbers > rather than a specific currency/BigDecimal converter. > > http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/mai > n/java/org/apache/myfaces/custom/convertNumber/TypedNumberConverter.java > ?view=markup > > > > On 12/18/06, Matthias Wessendorf wrote: > > I think bigdecimal should work, since it is not uncommon > > to use that type for currency values... > > > > -M > > > > On 12/14/06, David Brunette wrote: > > > > > > > > > Hi everybody. > > > > > > > > > > > > I am having a problem with using a in my > app > > > for submitting currency values from an inputText (see the example > > > below). I have tracked the problem down to the fact the value is > bound > > > to a BigDecimal in my bean. If I change the type to be Double, this > all > > > works fine... but the trouble is that I have to use BigDecimal in my > > > bean, so simply changing the type is not an option for me. > > > > > > > > > > > > I've dug into the Trinidad code and updated the BaseConverter > class > > > to successfully use with a BigDecimal value. > But > > > before I create a bug and submit a patch, I would like to know if > there > > > is any reason in particular that BigDecimal does not seem to be > > > supported. Was it just missed, or was it left out for a specific > > > reason? > > > > > > > > > > > > Thanks... > > > > > > > > > > > > Dave > > > > > > > > > > > > > > > > > value="#{myBean.monthlyIncome}" > > > > > > label="Monthly Income"> > > > > > > > > currencyCode="USD"/> > > > > > > > > > > > > The information transmitted herewith is sensitive information > of Chordiant Software or its customers and is intended only for use to > the individual or entity to which it is addressed. If the reader of this > message is not the intended recipient, you are hereby notified that any > review, retransmission, dissemination, distribution, copying or other > use of, or taking of any action in reliance upon, this information is > strictly prohibited. If you have received this communication in error, > please contact the sender and delete the material from your computer. > > > > > > > > > > > > -- > > Matthias Wessendorf > > http://tinyurl.com/fmywh > > > > further stuff: > > blog: http://jroller.com/page/mwessendorf > > mail: mwessendorf-at-gmail-dot-com > > > The information transmitted herewith is sensitive information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer. >