Skip to content

Commit

Permalink
fix(format-bytes): handle size less than 0 (directory)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElonH committed May 29, 2020
1 parent 31c0919 commit f3280b4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/app/utils/format-bytes.ts
Expand Up @@ -3,6 +3,7 @@
* License: MIT
*/
export function FormatBytes(bytes: number, decimals = 2) {
if (bytes < 0) return '-';
if (bytes === 0) return '0 B';

const k = 1024;
Expand Down

0 comments on commit f3280b4

Please sign in to comment.