Browse Source

int64 for metric units (#1419)

mmetc 3 years ago
parent
commit
1e63727064
1 changed files with 2 additions and 2 deletions
  1. 2 2
      cmd/crowdsec-cli/utils.go

+ 2 - 2
cmd/crowdsec-cli/utils.go

@@ -760,7 +760,7 @@ func BackupHub(dirPath string) error {
 }
 
 type unit struct {
-	value  int
+	value  int64
 	symbol string
 }
 
@@ -794,7 +794,7 @@ var ranges = []unit{
 func formatNumber(num int) string {
 	goodUnit := unit{}
 	for _, u := range ranges {
-		if num >= u.value {
+		if int64(num) >= u.value {
 			goodUnit = u
 			break
 		}