From a35776a62e4bcafaef66ff2f66e5bb4775a49b7a Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 9 Jun 2021 11:14:00 +0800 Subject: [PATCH] tidy yp formating --- Roo/util/Format.js | 4 ++-- docs/src/Roo_util_Format.js.html | 2 +- roojs-all.js | 2 +- roojs-core-debug.js | 2 +- roojs-core.js | 2 +- roojs-debug.js | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Roo/util/Format.js b/Roo/util/Format.js index dd9c0dc49b..249fd708ee 100644 --- a/Roo/util/Format.js +++ b/Roo/util/Format.js @@ -255,12 +255,12 @@ Roo.util.Format = function(){ */ size : function(value, decimals) { - var sizes = ['b', 'k', 'M', 'G', 'T']; + var sizes = ['b', 'k', 'm', 'g', 't']; if (value == 0) { return 0; } var i = parseInt(Math.floor(Math.log(value) / Math.log(1024))); - return Roo.util.Format.number(value/ Math.pow(1024, i) ,decimals) + ' ' + sizes[i]; + return Roo.util.Format.number(value/ Math.pow(1024, i) ,decimals) + sizes[i]; } diff --git a/docs/src/Roo_util_Format.js.html b/docs/src/Roo_util_Format.js.html index 7e7630980f..3fce3b5564 100644 --- a/docs/src/Roo_util_Format.js.html +++ b/docs/src/Roo_util_Format.js.html @@ -260,7 +260,7 @@ return 0; } var i = parseInt(Math.floor(Math.log(value) / Math.log(1024))); - return this.number(value/ Math.pow(1024, i) ,decimals) + ' ' + sizes[i]; + return Roo.util.Format.number(value/ Math.pow(1024, i) ,decimals) + ' ' + sizes[i]; } diff --git a/roojs-all.js b/roojs-all.js index ee4701d565..30c00af0ed 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -574,7 +574,7 @@ return eval(fn).apply(window,B);}else{return eval(fn).call(window,value);}},toFi 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; C=typeof(C)=='undefined'?',':C;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})/;if(C.length!=0){F=F.replace(/\B(?=(\d{3})+(?!\d))/g,C);}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,""); -},size:function(B,C){var D=['b','k','M','G','T'];if(B==0){return 0;}var i=parseInt(Math.floor(Math.log(B)/Math.log(1024)));return this.number(B/Math.pow(1024,i),C)+' '+D[i];}};}();Roo.util.Format.defaults={date:'d/M/Y'}; +},size:function(B,C){var D=['b','k','M','G','T'];if(B==0){return 0;}var i=parseInt(Math.floor(Math.log(B)/Math.log(1024)));return Roo.util.Format.number(B/Math.pow(1024,i),C)+' '+D[i];}};}();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)} ;if(B){st[B]=st[A];}st[A].tpl.compile();st[A].tpl.call=this.call.createDelegate(this);A++;}this.subCount=A;this.subs=st;};Roo.extend(Roo.MasterTemplate,Roo.Template,{subTemplateRe:/((?:.|\n)*?)<\/tpl>/gi,add:function(A,B){if(arguments.length==1){B=arguments[0]; diff --git a/roojs-core-debug.js b/roojs-core-debug.js index f41e409065..991ce719a9 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -14005,7 +14005,7 @@ Roo.util.Format = function(){ return 0; } var i = parseInt(Math.floor(Math.log(value) / Math.log(1024))); - return this.number(value/ Math.pow(1024, i) ,decimals) + ' ' + sizes[i]; + return Roo.util.Format.number(value/ Math.pow(1024, i) ,decimals) + ' ' + sizes[i]; } diff --git a/roojs-core.js b/roojs-core.js index 5dbbe1011e..f3f71292a1 100644 --- a/roojs-core.js +++ b/roojs-core.js @@ -574,7 +574,7 @@ return eval(fn).apply(window,B);}else{return eval(fn).call(window,value);}},toFi 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; C=typeof(C)=='undefined'?',':C;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})/;if(C.length!=0){F=F.replace(/\B(?=(\d{3})+(?!\d))/g,C);}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,""); -},size:function(B,C){var D=['b','k','M','G','T'];if(B==0){return 0;}var i=parseInt(Math.floor(Math.log(B)/Math.log(1024)));return this.number(B/Math.pow(1024,i),C)+' '+D[i];}};}();Roo.util.Format.defaults={date:'d/M/Y'}; +},size:function(B,C){var D=['b','k','M','G','T'];if(B==0){return 0;}var i=parseInt(Math.floor(Math.log(B)/Math.log(1024)));return Roo.util.Format.number(B/Math.pow(1024,i),C)+' '+D[i];}};}();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)} ;if(B){st[B]=st[A];}st[A].tpl.compile();st[A].tpl.call=this.call.createDelegate(this);A++;}this.subCount=A;this.subs=st;};Roo.extend(Roo.MasterTemplate,Roo.Template,{subTemplateRe:/((?:.|\n)*?)<\/tpl>/gi,add:function(A,B){if(arguments.length==1){B=arguments[0]; diff --git a/roojs-debug.js b/roojs-debug.js index b03a292c2e..3ec16bb019 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -14005,7 +14005,7 @@ Roo.util.Format = function(){ return 0; } var i = parseInt(Math.floor(Math.log(value) / Math.log(1024))); - return this.number(value/ Math.pow(1024, i) ,decimals) + ' ' + sizes[i]; + return Roo.util.Format.number(value/ Math.pow(1024, i) ,decimals) + ' ' + sizes[i]; } -- 2.39.2