From 26a0590e066e78d249de2b674f482fa362f4bdb9 Mon Sep 17 00:00:00 2001 From: milarin Date: Sun, 15 Jan 2023 14:25:37 +0100 Subject: [PATCH] debug --- utils.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils.go b/utils.go index 4f54754..28a6f87 100644 --- a/utils.go +++ b/utils.go @@ -8,13 +8,14 @@ import ( func FormatBytes[T gmath.Integer](bytes T) string { value := float64(bytes) - if value/1000000000000 >= 1000000000000 { + + if value >= 1000000000000 { return fmt.Sprintf("%.02fT", value/1000000000000) - } else if value/1000000000 >= 1000000000 { + } else if value >= 1000000000 { return fmt.Sprintf("%.02fG", value/1000000000) - } else if value/1000000 >= 1000000 { + } else if value >= 1000000 { return fmt.Sprintf("%.02fM", value/1000000) - } else if value/1000 >= 1000 { + } else if value >= 1000 { return fmt.Sprintf("%.02fK", value/1000) } else { return fmt.Sprintf("%.02fB", value)