I\'m using this function to convert a file size in bytes to a human-readable file size:
function getReadableFileSizeString(fileSizeInBytes) { var i = -1;
let bytes = 1024 * 10 * 10 * 10;
console.log(getReadableFileSizeString(bytes))
will return 1000.0Кб instead of 1MB