mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 10:26:53 +02:00
replace go-humanize with format.HumanBytes
This commit is contained in:
parent
423862042a
commit
01ea6002c4
4 changed files with 4 additions and 8 deletions
|
@ -12,11 +12,11 @@ const (
|
|||
func HumanBytes(b int64) string {
|
||||
switch {
|
||||
case b > GigaByte:
|
||||
return fmt.Sprintf("%d GB", b/GigaByte)
|
||||
return fmt.Sprintf("%.1f GB", float64(b)/GigaByte)
|
||||
case b > MegaByte:
|
||||
return fmt.Sprintf("%d MB", b/MegaByte)
|
||||
return fmt.Sprintf("%.1f MB", float64(b)/MegaByte)
|
||||
case b > KiloByte:
|
||||
return fmt.Sprintf("%d KB", b/KiloByte)
|
||||
return fmt.Sprintf("%.1f KB", float64(b)/KiloByte)
|
||||
default:
|
||||
return fmt.Sprintf("%d B", b)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue