modify BytesToSize
This commit is contained in:
parent
434dbb1dc2
commit
05dc9e190a
@ -54,7 +54,7 @@ func BytesToSize(size uint64) string {
|
|||||||
_ = iota
|
_ = iota
|
||||||
KB uint64 = 1 << (10 * iota)
|
KB uint64 = 1 << (10 * iota)
|
||||||
MB
|
MB
|
||||||
GB
|
GBc
|
||||||
TB
|
TB
|
||||||
)
|
)
|
||||||
switch {
|
switch {
|
||||||
@ -65,6 +65,6 @@ func BytesToSize(size uint64) string {
|
|||||||
case size >= KB:
|
case size >= KB:
|
||||||
return fmt.Sprintf("%.1f KB", float64(size)/float64(KB))
|
return fmt.Sprintf("%.1f KB", float64(size)/float64(KB))
|
||||||
default:
|
default:
|
||||||
return fmt.Sprintf("%d Bytes", size)
|
return fmt.Sprintf("%d B", size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user