Skip to content

Commit f123d8b

Browse files
Fix rounding off (#9054)
Co-authored-by: cweitat <[email protected]>
1 parent 4477d40 commit f123d8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/utils/file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const humanReadableBytes = (sizeInKb, absolute = true, si = true) => {
1313
do {
1414
bytes /= thresh;
1515
++u;
16-
} while (Math.abs(bytes) >= thresh && u < units.length - 1);
16+
} while (Math.round(Math.abs(bytes)*100)/100 >= thresh && u < units.length - 1);
1717
return `${bytes.toFixed(absolute ? 0 : 1)} ${units[u]}`;
1818
};
1919

0 commit comments

Comments
 (0)