[Fix][UI] Fix bytesToSize function calculation error. (#10628)

This commit is contained in:
Amy0104 2022-06-27 15:00:48 +08:00 committed by GitHub
parent 7dd7e4afe8
commit 7d91ad3c54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ const bytesToSize = (bytes) => {
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
const i = Math.floor(Math.log(bytes) / Math.log(k))
return parseInt((bytes / Math.pow(k, i)).toPrecision(3)) + ' ' + sizes[i]
return parseFloat((bytes / Math.pow(k, i)).toPrecision(3)) + ' ' + sizes[i]
}
/**