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 0C822186E5 for ; Wed, 10 Feb 2016 17:02:25 +0000 (UTC) Received: (qmail 99325 invoked by uid 500); 10 Feb 2016 17:02:18 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 99283 invoked by uid 500); 10 Feb 2016 17:02:18 -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 98753 invoked by uid 99); 10 Feb 2016 17:02:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2016 17:02:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 23DB02C1F62 for ; Wed, 10 Feb 2016 17:02:18 +0000 (UTC) Date: Wed, 10 Feb 2016 17:02:18 +0000 (UTC) From: "Mike Kienenberger (JIRA)" To: dev@myfaces.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (TRINIDAD-2533) TrNumberFormat doesn't parse native Numbers without Currency MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TRINIDAD-2533?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1= 5141177#comment-15141177 ]=20 Mike Kienenberger commented on TRINIDAD-2533: --------------------------------------------- We don't have any active Trinidad committers currently. If you provide a pa= tch in unified diff format from the root of the project, I will apply it. I= 've applied a number of IE11 fixes supplied by the community recently. If you would like assistance in tracking down the problem and creating a so= lution, I recommend posting a message on the dev@myfaces mailing list to se= e if any other JSF developers have an idea. > TrNumberFormat doesn't parse native Numbers without Currency > ------------------------------------------------------------ > > Key: TRINIDAD-2533 > URL: https://issues.apache.org/jira/browse/TRINIDAD-2533 > Project: MyFaces Trinidad > Issue Type: Bug > Affects Versions: 2.0.0-beta-2 > Environment: Oracle ADF > Reporter: Falco Wockenfu=C3=9F > > If you enter a Number in a Currency-Field with a decimal separator (other= than ".") and without trailing currency symbol you get a parse Error. > Test Case - Type in JS Console: > var tr =3D new TrNumberConverter( null, "currency", "de_DE" ); > tr.getAsObject( "20,50" ); // Parse Error > tr.getAsObject( "20,50 =E2=82=AC" ); // Working > tr.getAsObject( "20" ); // Working > Cause: > The Method TrNumberFormat.prototype.removePrefixAndSuffix will fail, if n= ot both matching Prefix and Suffix for Positive or Negative are present. If= only one of both is present an exception is thrown and parsing fails. > Since the Prefix for positive Currency is "" (the empty string) it will a= lways match and try to find the matching suffix "=E2=82=AC" or fail. > In the case of an exception the default parseFloat is used as a fallback,= which works for default english notation, so plain Numbers and using the d= ot as a decimal separator will work. > Expected Behaviour and proposed Fix: > Entering a locale Numberformat without Currency Symbol should be parsed w= ithout giving an error. The removePrefixAndSuffix Method should be more len= ient and also accept input without currency suffix. -- This message was sent by Atlassian JIRA (v6.3.4#6332)