Browse Source

Fix code length '1 Byte'

pull/6/head
Menci 8 years ago
parent
commit
9053cea33a
  1. 2
      utility.js

2
utility.js

@ -134,7 +134,7 @@ module.exports = {
formatSize(x) { formatSize(x) {
let res = filesize(x, { fixed: 1 }).calculate(); let res = filesize(x, { fixed: 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 === 'Bytes') 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', '');
return res.fixed + ' ' + res.suffix; return res.fixed + ' ' + res.suffix;
}, },

Loading…
Cancel
Save