Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/assets')
-rw-r--r--web/assets/js/util/common.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/web/assets/js/util/common.js b/web/assets/js/util/common.js
index 6dad047d..ab642849 100644
--- a/web/assets/js/util/common.js
+++ b/web/assets/js/util/common.js
@@ -5,7 +5,9 @@ const ONE_TB = ONE_GB * 1024;
const ONE_PB = ONE_TB * 1024;
function sizeFormat(size) {
- if (size < ONE_KB) {
+ if (size < 0) {
+ return "0 B";
+ } else if (size < ONE_KB) {
return size.toFixed(0) + " B";
} else if (size < ONE_MB) {
return (size / ONE_KB).toFixed(2) + " KB";