Return-Path: X-Original-To: apmail-myfaces-dev-archive@www.apache.org Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 11471E481 for ; Thu, 24 Jan 2013 22:51:15 +0000 (UTC) Received: (qmail 12877 invoked by uid 500); 24 Jan 2013 22:51:13 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 12830 invoked by uid 500); 24 Jan 2013 22:51:13 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 12763 invoked by uid 99); 24 Jan 2013 22:51:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jan 2013 22:51:13 +0000 Date: Thu, 24 Jan 2013 22:51:13 +0000 (UTC) From: "Yee-Wah Lee (JIRA)" To: dev@myfaces.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (TRINIDAD-2354) convertNumber type=percent server and client results differ. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TRINIDAD-2354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13562084#comment-13562084 ] Yee-Wah Lee commented on TRINIDAD-2354: --------------------------------------- On the server, creating a NumberFormat with type= percent has maxFractionDigits = 0 However, on the client, the default maxFractionDigits=3. So the defaults need to be changed in TrNumberFormat() constructor. Also, the following code which creates a NumberFormat instance to parse the percent/currency string should copy the max/min Integer/FractionDigits values. TrNumberConverter_getAsObject() { // The user could have just left off the percent/currency symbol, so try parsing 'numberString' as a Number instead; if it still fails, then // throw a converter exception. try { numberString = TrNumberFormat.getNumberInstance().parse(numberString)+""; } } > convertNumber type=percent server and client results differ. > ------------------------------------------------------------- > > Key: TRINIDAD-2354 > URL: https://issues.apache.org/jira/browse/TRINIDAD-2354 > Project: MyFaces Trinidad > Issue Type: Bug > Reporter: Yee-Wah Lee > Priority: Minor > > 1. Create an inputText with child numberConverter, type=percent. Or, see example here: > http://example.irian.at/trinidad-demo/faces/convertValidate/convertValidate.jspx > 2. Enter 2.75 into the input field and Submit > 2a. The client converter initially changes it to "2.75%" > 2b. After the server returns, it displays as "3%". -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira