JSCompressor

This commit is contained in:
oc 2018-04-18 18:42:34 +08:00
parent 4c4d869d40
commit b134f4ac4f
2 changed files with 6 additions and 6 deletions

View File

@ -150,18 +150,18 @@ utils.prototype.formatBigNumber = function (x) {
if (!core.isset(x)) return '???'; if (!core.isset(x)) return '???';
var all = [ var all = [
{"val": 10e20, "char": "g"}, {"val": 10e20, "c": "g"},
{"val": 10e16, "char": "j"}, {"val": 10e16, "c": "j"},
{"val": 10e12, "char": "z"}, {"val": 10e12, "c": "z"},
{"val": 10e8, "char": "e"}, {"val": 10e8, "c": "e"},
{"val": 10e4, "char": "w"}, {"val": 10e4, "c": "w"},
] ]
for (var i=0;i<all.length;i++) { for (var i=0;i<all.length;i++) {
var one = all[i]; var one = all[i];
if (x>=10*one.val) { if (x>=10*one.val) {
var v = x/one.val; var v = x/one.val;
return v.toFixed(Math.max(0, Math.floor(4-Math.log10(v)))) + one.char; return v.toFixed(Math.max(0, Math.floor(4-Math.log10(v)))) + one.c;
} }
} }