-1
顯示上傳文件大小時。以KB/MB爲單位的大小,僅最大。逗號後的2位數
function File(name, size) {
this.name = name;
this.size = (size/1024);
this.url = null;
this.isUploadCompleted = false;
this.archiveStatus = null;
this.progressBarObject = null;
this.removeObject = null;
}
我現在的輸出Size: 846.08203125KB
。我的要求輸出size: 10.0KB
。我必須在代碼中做什麼更改?
問題是什麼? – Satpal
上傳文件大小應該顯示,它以上面顯示的格式顯示,我必須在代碼中做什麼更改? – user6240479
使用'.toFixed(2)'數字方法。 'this.size =(size/1024).toFixed(2);' – jcubic