int64 for metric units (#1419)

This commit is contained in:
mmetc 2022-04-04 21:50:19 +02:00 committed by GitHub
parent 7e36432bf5
commit 1e63727064
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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