modify BytesToSize
This commit is contained in:
parent
434dbb1dc2
commit
05dc9e190a
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user