FAQ
Author: gcrawford
Date: Tue Apr 17 00:59:57 2012
New Revision: 1326857

URL: http://svn.apache.org/viewvc?rev=1326857&view=rev
Log:
TRINIDAD-2219 Negative numbers for Bidi/RTL languages are not handled correctly

Thanks to Bino

Modified:
myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js

Modified: myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js?rev=1326857&r1=1326856&r2=1326857&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js (original)
+++ myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js Tue Apr 17 00:59:57 2012
@@ -980,6 +980,23 @@ function _decimalParse(
// decimal separator allowed by JS
var decimal = new RegExp("\\" + symbols.getDecimalSeparator(), "g");
numberString = numberString.replace(decimal, ".");
+
+ // JIRA TRINIDAD-2219: When the string is a negative bidi number, e.g. "1-", the
+ //(numberString*numberString) and (numberString / numberString) return NaN
+ // and is unable to parse it so in Bidi, we check if the number is of the format "X-"
+ // and convert it to "-X" which Javascript can understands.
+
+ var isLTR = document.documentElement["dir"].toUpperCase() == "LTR";
+
+ if(!isLTR)
+ {
+ var numberStringLength = numberString.length ;
+
+ if(numberString.lastIndexOf("-") == (numberStringLength - 1))
+ {
+ numberString = "-" + numberString.substring(0, numberStringLength - 1);
+ }
+ }//end of isLTR check
}

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categoriesmyfaces
postedApr 17, '12 at 1:00a
activeApr 17, '12 at 1:00a
posts1
users1
websitemyfaces.apache.org

1 user in discussion

Gcrawford: 1 post

People

Translate

site design / logo © 2019 Grokbase