fix nan undefined shown on storage card

This commit is contained in:
Abhinav 2022-12-16 15:05:43 +05:30
parent 5f4df85148
commit 4a53834062

View file

@ -41,7 +41,7 @@ export function makeHumanReadableStorage(
bytes: number,
round: 'round-up' | 'round-down' = 'round-down'
): string {
if (bytes === 0) {
if (bytes <= 0) {
return '0 MB';
}
const i = Math.floor(Math.log(bytes) / Math.log(1024));