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 920559717 for ; Thu, 26 Apr 2012 18:36:43 +0000 (UTC) Received: (qmail 6900 invoked by uid 500); 26 Apr 2012 18:36:43 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 6832 invoked by uid 500); 26 Apr 2012 18:36:42 -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 6817 invoked by uid 99); 26 Apr 2012 18:36:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2012 18:36:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2012 18:36:40 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 550194126AE for ; Thu, 26 Apr 2012 18:36:19 +0000 (UTC) Date: Thu, 26 Apr 2012 18:36:19 +0000 (UTC) From: "Yee-Wah Lee (JIRA)" To: dev@myfaces.apache.org Message-ID: <274669808.6329.1335465379349.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1492203330.27317.1316019548894.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Issue Comment Edited] (TRINIDAD-2139) Client NumberConverter with type=percent ignores maxfractiondigits when formatting 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-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223545#comment-13223545 ] Yee-Wah Lee edited comment on TRINIDAD-2139 at 4/26/12 6:34 PM: ---------------------------------------------------------------- 1.2.12.7.0 fix for Trinidad-2139, allow NumberFormat to honor maxFractionDigits Patch also works for 1.2.12.6.2 branch was (Author: yeelee): 1.2.12.7.0 fix for Trinidad-2139, allow NumberFormat to honor maxFractionDigits > Client NumberConverter with type=percent ignores maxfractiondigits when formatting > ---------------------------------------------------------------------------------- > > Key: TRINIDAD-2139 > URL: https://issues.apache.org/jira/browse/TRINIDAD-2139 > Project: MyFaces Trinidad > Issue Type: Bug > Components: Components > Affects Versions: 2.0.0-core > Reporter: Yee-Wah Lee > Assignee: Gabrielle Crawford > Priority: Minor > Fix For: 2.0.1-core > > Attachments: branch121270_2139_maxFracDigits.diff, trunk_2139_numberPercentMaxFrac.diff > > > NumberFormat.js contains the following code: > TrNumberFormat.prototype.percentageToString = function(number) > { > number = number * 100; > number = this.getRounded(number); > .. number = this.numberToString(number); > } > consideration the number of fractionDigits but numberToString later will. > TrNumberFormat.prototype.getRounded = function(val) > { > val = this.moveDecimalRight(val); > val = Math.round(val); > val = this.moveDecimalLeft(val); > return val; > } > Math.round function will round to the nearest integer. With the earlier multiplication to 100, precision is preserved to at most two digits, regardless of the maxFractionDigits attribute. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira