Skip to content

Commit

Permalink
fix: game download information
Browse files Browse the repository at this point in the history
  • Loading branch information
JackEnx authored and JackEnx committed Apr 19, 2024
1 parent 2893ff5 commit 6937e1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/utils/format-bytes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const FORMAT = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];

export const formatBytes = (bytes: number): string => {
if (!Number.isFinite(bytes) || isNaN(bytes) || bytes < 0) {
return `N/A ${FORMAT[0]}`;
if (!Number.isFinite(bytes) || isNaN(bytes) || bytes <= 0) {
return `0 ${FORMAT[0]}`;
}

const byteKBase = 1024;
Expand Down

0 comments on commit 6937e1a

Please sign in to comment.