提交 25dbf846 编写于 作者: G gongfuxiang

v6.0 文件大小计算展示优

上级 74561297
......@@ -4678,16 +4678,16 @@ $(function () {
$.each(this.files, function () {
var unit = 'KB';
var size = 0;
if (this.size < 1024) {
var kb = this.size / 1024;
if (kb < 1024) {
unit = 'KB';
size = Math.round((this.size / 1024) * 100) / 100;
} else if (this.size < 1024 * 1024) {
size = Math.round(kb * 100) / 100;
} else if (kb < 1024 * 1024) {
unit = 'MB';
size = Math.round((this.size / (1024 * 1024)) * 100) / 100;
} else if (this.size < 1024 * 1024 * 1024) {
} else if (kb < 1024 * 1024 * 1024) {
unit = 'GB';
size = Math.round((this.size / (1024 * 1024 * 1024)) * 100) / 100;
}
fileNames += '<span class="am-font-weight">' + this.name + '</span> <span class="am-color-999">(' + size + unit + ')</span>';
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册