Re-apply some Prettier formatting after merge

This commit is contained in:
Bryan Ashby
2022-06-12 14:12:03 -06:00
parent c93b8cda81
commit 9172fdda9d
37 changed files with 978 additions and 712 deletions

View File

@@ -379,9 +379,9 @@ 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)).toString();
if(withAbbr) {
const i = 0 === byteSize ? byteSize : Math.floor(Math.log(byteSize) / Math.log(1024));
let result = parseFloat((byteSize / Math.pow(1024, i)).toFixed(decimals)).toString();
if (withAbbr) {
result += ` ${BYTE_SIZE_ABBRS[i]}`;
}
return result;