Roo/util/Format.js
authorAlan Knowles <alan@roojs.com>
Thu, 21 Jun 2018 02:23:07 +0000 (10:23 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 21 Jun 2018 02:23:07 +0000 (10:23 +0800)
Roo/util/Format.js

index 5092b2f..8c90026 100644 (file)
@@ -195,9 +195,7 @@ Roo.util.Format = function(){
             // add comma's
             
             if(thousandsDelimiter.length != 0) {
-                while (r.test(whole)) {
-                    whole = whole.replace(r, '$1' + thousandsDelimiter + '$2');
-                }
+                whole = whole.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsDelimiter );
             } 
             
             var sub = ps[1] ?