|
|
@ -121,8 +121,8 @@ module.exports = { |
|
|
|
} |
|
|
|
} |
|
|
|
return sgn + util.format('%s:%s:%s', toStringWithPad(x / 3600), toStringWithPad(x / 60 % 60), toStringWithPad(x % 60)); |
|
|
|
return sgn + util.format('%s:%s:%s', toStringWithPad(x / 3600), toStringWithPad(x / 60 % 60), toStringWithPad(x % 60)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
formatSize(x) { |
|
|
|
formatSize(x, precision) { |
|
|
|
let res = filesize(x, { fixed: 1 }).calculate(); |
|
|
|
let res = filesize(x, { fixed: precision || 1 }).calculate(); |
|
|
|
if (res.result === parseInt(res.result)) res.fixed = res.result.toString(); |
|
|
|
if (res.result === parseInt(res.result)) res.fixed = res.result.toString(); |
|
|
|
if (res.suffix.startsWith('Byte')) res.suffix = 'B'; |
|
|
|
if (res.suffix.startsWith('Byte')) res.suffix = 'B'; |
|
|
|
else res.suffix = res.suffix.replace('iB', ''); |
|
|
|
else res.suffix = res.suffix.replace('iB', ''); |
|
|
|