modify BytesToSize

This commit is contained in:
Nite07 2024-11-22 02:10:03 +08:00
parent 434dbb1dc2
commit 05dc9e190a

View File

@ -54,7 +54,7 @@ func BytesToSize(size uint64) string {
_ = iota
KB uint64 = 1 << (10 * iota)
MB
GB
GBc
TB
)
switch {
@ -65,6 +65,6 @@ func BytesToSize(size uint64) string {
case size >= KB:
return fmt.Sprintf("%.1f KB", float64(size)/float64(KB))
default:
return fmt.Sprintf("%d Bytes", size)
return fmt.Sprintf("%d B", size)
}
}