Some more stats

This commit is contained in:
Bryan Ashby
2020-11-09 21:32:34 -07:00
parent 52ae983cb4
commit d6cc53c263
6 changed files with 61 additions and 6 deletions

View File

@@ -337,7 +337,7 @@ function formatByteSizeAbbr(byteSize) {
function formatByteSize(byteSize, withAbbr = false, decimals = 2) {
const i = 0 === byteSize ? byteSize : Math.floor(Math.log(byteSize) / Math.log(1024));
let result = parseFloat((byteSize / Math.pow(1024, i)).toFixed(decimals));
let result = parseFloat((byteSize / Math.pow(1024, i)).toFixed(decimals)).toString();
if(withAbbr) {
result += ` ${BYTE_SIZE_ABBRS[i]}`;
}