mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-11-29 18:39:16 +08:00
v6.0 文件大小计算展示优
This commit is contained in:
parent
74561297db
commit
25dbf846f1
@ -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>';
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user