mirror of
https://github.com/restic/restic.git
synced 2024-12-22 15:57:07 +00:00
Add space between number and unit
This commit is contained in:
parent
3f0ea78b86
commit
6d0a6844e2
1 changed files with 4 additions and 4 deletions
|
@ -17,13 +17,13 @@ func format_bytes(c uint64) string {
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case c > 1<<40:
|
case c > 1<<40:
|
||||||
return fmt.Sprintf("%.3fTiB", b/(1<<40))
|
return fmt.Sprintf("%.3f TiB", b/(1<<40))
|
||||||
case c > 1<<30:
|
case c > 1<<30:
|
||||||
return fmt.Sprintf("%.3fGiB", b/(1<<30))
|
return fmt.Sprintf("%.3f GiB", b/(1<<30))
|
||||||
case c > 1<<20:
|
case c > 1<<20:
|
||||||
return fmt.Sprintf("%.3fMiB", b/(1<<20))
|
return fmt.Sprintf("%.3f MiB", b/(1<<20))
|
||||||
case c > 1<<10:
|
case c > 1<<10:
|
||||||
return fmt.Sprintf("%.3fKiB", b/(1<<10))
|
return fmt.Sprintf("%.3f KiB", b/(1<<10))
|
||||||
default:
|
default:
|
||||||
return fmt.Sprintf("%dB", c)
|
return fmt.Sprintf("%dB", c)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue