dev #6

Merged
bvbej merged 2 commits from dev into main 2024-08-09 15:35:20 +08:00
Showing only changes of commit e65d101476 - Show all commits

View File

@ -5,6 +5,7 @@ import (
"bytes"
"errors"
"fmt"
"github.com/spf13/cast"
"io"
"math"
"math/rand"
@ -43,7 +44,7 @@ func ByteFmt(size int64) string {
if frac > 0 {
return fmt.Sprintf("%.1f%s", math.Floor(val*10)/10, unitArr[p])
} else {
return fmt.Sprintf("%d%s", int(val), unitArr[p])
return fmt.Sprintf("%d%s", cast.ToInt(val), unitArr[p])
}
}