Skip to content

Commit

Permalink
Merge pull request #41 from hydralauncher/fix/game-download-information
Browse files Browse the repository at this point in the history
fix: game download information
  • Loading branch information
Hydra authored Apr 19, 2024
2 parents 2893ff5 + 6937e1a commit 54766e2
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 54766e2

Please sign in to comment.