Add new file base system stats and MCI codes

This commit is contained in:
Bryan Ashby 2017-09-09 11:48:43 -06:00
parent 1c2926fbe9
commit 3980c8acae
5 changed files with 91 additions and 4 deletions

View file

@ -326,9 +326,7 @@ function formatByteSizeAbbr(byteSize) {
return SIZE_ABBRS[Math.floor(Math.log(byteSize) / Math.log(1024))];
}
function formatByteSize(byteSize, withAbbr, decimals) {
withAbbr = withAbbr || false;
decimals = decimals || 3;
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));
if(withAbbr) {