mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
Merge pull request #41 from hydralauncher/fix/game-download-information
fix: game download information
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user