You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2007/08/01 15:48:08 UTC

svn commit: r561796 - /myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/NumberFormat.js

Author: matzew
Date: Wed Aug  1 06:48:06 2007
New Revision: 561796

URL: http://svn.apache.org/viewvc?view=rev&rev=561796
Log:
Added groupingUsed to TrNumberFormat class.
JSDoc taken from Apache Harmony project

Modified:
    myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/NumberFormat.js

Modified: myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/NumberFormat.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/NumberFormat.js?view=diff&rev=561796&r1=561795&r2=561796
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/NumberFormat.js (original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/NumberFormat.js Wed Aug  1 06:48:06 2007
@@ -29,11 +29,13 @@
   this._pSuf = getLocaleSymbols().getPositiveSuffix();
   this._nPre = getLocaleSymbols().getNegativePrefix();
   this._nSuf = getLocaleSymbols().getNegativeSuffix();
-  //default values, similar to JDK
+
+  //default values, similar to JDK (values from Apache Harmony)
   this._maxFractionDigits = 3;
   this._maxIntegerDigits  = 40;
   this._minFractionDigits = 0;
   this._minIntegerDigits  = 1;
+  this._groupingUsed = true;
   
 }
 //***********************
@@ -65,6 +67,28 @@
 }
 
 /**
+ * Sets whether this NumberFormat formats and parses numbers using a
+ * grouping separator.
+ * 
+ * @param value true when a grouping separator is used, false otherwise
+ */
+TrNumberFormat.prototype.setGroupingUsed = function(groupingUsed)
+{
+  this._groupingUsed = groupingUsed;
+}
+
+/**
+ * Answers whether this NumberFormat formats and parses numbers using a
+ * grouping separator.
+ * 
+ * @return true when a grouping separator is used, false otherwise
+ */
+TrNumberFormat.prototype.isGroupingUsed = function()
+{
+  return this._groupingUsed;
+}
+
+/**
  * Used to specify the new maximum count of integer digits that are printed
  * when formatting. If the maximum is less than the number of integer
  * digits, the most significant digits are truncated.
@@ -466,8 +490,11 @@
     ints = leadingZeros + ints;
   }
   
-  ints = this._addGroupingSeparators(ints);
-  
+  if(this.isGroupingUsed())
+  {
+    ints = this._addGroupingSeparators(ints);
+  }
+
   return ints;
 }