From cf3fc315159d6f38c826064ffab95d686a8bfac7 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 9 Jun 2021 11:15:16 +0800 Subject: [PATCH] prefer larger codes for MGT --- Roo/util/Format.js | 2 +- docs/src/Roo_util_Format.js.html | 4 ++-- roojs-all.js | 2 +- roojs-core-debug.js | 4 ++-- roojs-core.js | 2 +- roojs-debug.js | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Roo/util/Format.js b/Roo/util/Format.js index 249fd708ee..6afc6ffdec 100644 --- a/Roo/util/Format.js +++ b/Roo/util/Format.js @@ -255,7 +255,7 @@ 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; } diff --git a/docs/src/Roo_util_Format.js.html b/docs/src/Roo_util_Format.js.html index 3fce3b5564..febfd9b669 100644 --- a/docs/src/Roo_util_Format.js.html +++ b/docs/src/Roo_util_Format.js.html @@ -255,12 +255,12 @@ */ 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/roojs-all.js b/roojs-all.js index 30c00af0ed..8f917959a9 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 Roo.util.Format.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 991ce719a9..175b8c9ffa 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -14000,12 +14000,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/roojs-core.js b/roojs-core.js index f3f71292a1..757c0de60a 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 Roo.util.Format.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 3ec16bb019..b106290d36 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -14000,12 +14000,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]; } -- 2.39.2