mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-12 19:22:28 +00:00
fix: game download information
This commit is contained in:
parent
407c736522
commit
50da09f44e
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue