2
2
mirror of https://github.com/octoleo/restic.git synced 2024-05-31 08:00:48 +00:00

Add space between number and unit

This commit is contained in:
Alexander Neumann 2014-11-23 14:53:46 +01:00
parent 3f0ea78b86
commit 6d0a6844e2

View File

@ -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)
} }