修改尺寸
This commit is contained in:
@@ -46,7 +46,7 @@ export function getExtension(name) {
|
|||||||
|
|
||||||
export function bytesToSize(bytes) {
|
export function bytesToSize(bytes) {
|
||||||
if (bytes === 0) return "0 B";
|
if (bytes === 0) return "0 B";
|
||||||
var k = 1024,
|
var k = process.platform === 'linux' ? 1000 : 1024,
|
||||||
sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
|
sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
|
||||||
i = Math.floor(Math.log(bytes) / Math.log(k));
|
i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||||
return (bytes / Math.pow(k, i)).toPrecision(3) + " " + sizes[i];
|
return (bytes / Math.pow(k, i)).toPrecision(3) + " " + sizes[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user