Fix math on human filesize to match the relays page

This commit is contained in:
Alex Thomassen 2023-10-31 15:38:06 +01:00
parent 30ffd1089c
commit 6fb202d559

View File

@ -8,8 +8,8 @@ function humanByteSize(input) {
return '0 B';
}
const i = Math.floor(Math.log(input) / Math.log(1024));
return (input / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
const i = Math.floor(Math.log(input) / Math.log(1000));
return (input / Math.pow(1000, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
}
// Convert seconds to human friendly time, with days