Roo/util/Format.js
authorjohn <john@roojs.com>
Mon, 11 Jun 2018 03:16:35 +0000 (11:16 +0800)
committerjohn <john@roojs.com>
Mon, 11 Jun 2018 03:16:35 +0000 (11:16 +0800)
Roo/util/Format.js

index 01a2d81..f9ba0e7 100644 (file)
@@ -176,10 +176,12 @@ Roo.util.Format = function(){
         number : function(v,decimals)
         {
             // multiply and round.
-            decimals = typeof(decimals) == 'undefined' ? 2 : decimals;
-            var mul = Math.pow(10, decimals);
-            var zero = String(mul).substring(1);
-            v = (Math.round((v-0)*mul))/mul;
+            if(decimals !== false) {
+                decimals = typeof(decimals) == 'undefined' ? 2 : decimals;
+                var mul = Math.pow(10, decimals);
+                var zero = String(mul).substring(1);
+                v = (Math.round((v-0)*mul))/mul;
+            }
             
             // if it's '0' number.. then