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
1 changed files with 4 additions and 4 deletions

View File

@ -17,13 +17,13 @@ func format_bytes(c uint64) string {
switch {
case c > 1<<40:
return fmt.Sprintf("%.3fTiB", b/(1<<40))
return fmt.Sprintf("%.3f TiB", b/(1<<40))
case c > 1<<30:
return fmt.Sprintf("%.3fGiB", b/(1<<30))
return fmt.Sprintf("%.3f GiB", b/(1<<30))
case c > 1<<20:
return fmt.Sprintf("%.3fMiB", b/(1<<20))
return fmt.Sprintf("%.3f MiB", b/(1<<20))
case c > 1<<10:
return fmt.Sprintf("%.3fKiB", b/(1<<10))
return fmt.Sprintf("%.3f KiB", b/(1<<10))
default:
return fmt.Sprintf("%dB", c)
}