roojs-core.js
authorjohn <john@roojs.com>
Wed, 13 Jun 2018 03:00:24 +0000 (11:00 +0800)
committerjohn <john@roojs.com>
Wed, 13 Jun 2018 03:00:24 +0000 (11:00 +0800)
roojs-core-debug.js

roojs-core-debug.js
roojs-core.js

index 85f064d..9cfe96a 100644 (file)
@@ -13770,7 +13770,7 @@ Roo.util.Format = function(){
          * @param {Number} decimals number of decimal places
          * @return {String} The formatted currency string
          */
-        number : function(v,decimals)
+        number : function(v, decimals, thousandsDelimiter = ',')
         {
             // multiply and round.
             decimals = typeof(decimals) == 'undefined' ? 2 : decimals;
@@ -13785,11 +13785,10 @@ Roo.util.Format = function(){
             var ps = v.split('.');
             var whole = ps[0];
             
-            
             var r = /(\d+)(\d{3})/;
             // add comma's
             while (r.test(whole)) {
-                whole = whole.replace(r, '$1' + ',' + '$2');
+                whole = whole.replace(r, '$1' + thousandsDelimiter + '$2');
             }
             
             
index 52413fb..fbbb83a 100644 (file)
@@ -564,9 +564,9 @@ Roo.util.Format=function(){var A=/^\s+|\s+$/g;return {ellipsis:function(B,C){if(
 },htmlDecode:function(B){return !B?B:String(B).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"');},trim:function(B){return String(B).replace(A,"");},substr:function(B,C,D){return String(B).substr(C,D);},lowercase:function(B){return String(B).toLowerCase();
 },uppercase:function(B){return String(B).toUpperCase();},capitalize:function(B){return !B?B:B.charAt(0).toUpperCase()+B.substr(1).toLowerCase();},call:function(value,fn){if(arguments.length>2){var B=Array.prototype.slice.call(arguments,2);B.unshift(value);
 return eval(fn).apply(window,B);}else{return eval(fn).call(window,value);}},toFixed:function(v,n){if(!n){return Math.round(v-0);}var B=Math.pow(10,n+1);v=(Math.round((v-0)*B))/B;var z=(''+B).substring(2);if(v==Math.floor(v)){return Math.floor(v)+'.'+z;}var ps=String(v).split('.');
-var fd=(ps[1]+z);var r=fd.substring(0,n);var rm=fd.substring(n);if(rm<5){return ps[0]+'.'+r;}r*=1;r++;if(String(r).length!=n){ps[0]*=1;ps[0]++;r=String(r).substring(1);}return ps[0]+'.'+r;},usMoney:function(v){return '$'+Roo.util.Format.number(v);},number:function(v,B){B=typeof(B)=='undefined'?2:B;
-var C=Math.pow(10,B);var D=String(C).substring(1);v=(Math.round((v-0)*C))/C;v=String(v);var ps=v.split('.');var E=ps[0];var r=/(\d+)(\d{3})/;while(r.test(E)){E=E.replace(r,'$1'+','+'$2');}var F=ps[1]?(B?('.'+ps[1]+D.substring(ps[1].length)):''):(B?('.'+D):'');
-return E+F;},date:function(v,B){if(!v){return "";}if(!(v instanceof Date)){v=new Date(Date.parse(v));}return v.dateFormat(B||Roo.util.Format.defaults.date);},dateRenderer:function(B){return function(v){return Roo.util.Format.date(v,B);};},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"");
+var fd=(ps[1]+z);var r=fd.substring(0,n);var rm=fd.substring(n);if(rm<5){return ps[0]+'.'+r;}r*=1;r++;if(String(r).length!=n){ps[0]*=1;ps[0]++;r=String(r).substring(1);}return ps[0]+'.'+r;},usMoney:function(v){return '$'+Roo.util.Format.number(v);},number:function(v,B,C=','){B=typeof(B)=='undefined'?2:B;
+var D=Math.pow(10,B);var E=String(D).substring(1);v=(Math.round((v-0)*D))/D;v=String(v);var ps=v.split('.');var F=ps[0];var r=/(\d+)(\d{3})/;while(r.test(F)){F=F.replace(r,'$1'+C+'$2');}var G=ps[1]?(B?('.'+ps[1]+E.substring(ps[1].length)):''):(B?('.'+E):'');
+return F+G;},date:function(v,B){if(!v){return "";}if(!(v instanceof Date)){v=new Date(Date.parse(v));}return v.dateFormat(B||Roo.util.Format.defaults.date);},dateRenderer:function(B){return function(v){return Roo.util.Format.date(v,B);};},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"");
 }};}();Roo.util.Format.defaults={date:'d/M/Y'};
 // Roo/MasterTemplate.js
 Roo.MasterTemplate=function(){Roo.MasterTemplate.superclass.constructor.apply(this,arguments);this.originalHtml=this.html;var st={};var m,re=this.subTemplateRe;re.lastIndex=0;var A=0;while(m=re.exec(this.html)){var B=m[1],C=m[2];st[A]={name:B,index:A,buffer:[],tpl:new Roo.Template(C)}