equal
deleted
inserted
replaced
100 this.amount = amount; |
100 this.amount = amount; |
101 } |
101 } |
102 } |
102 } |
103 |
103 |
104 public static String formatBytes(long bytes, String separation) { |
104 public static String formatBytes(long bytes, String separation) { |
|
105 if (bytes == 1) { |
|
106 return "1 byte"; |
|
107 } |
105 if (bytes < 1024) { |
108 if (bytes < 1024) { |
106 return bytes + " bytes"; |
109 return bytes + " bytes"; |
107 } |
110 } |
108 int exp = (int) (Math.log(bytes) / Math.log(1024)); |
111 int exp = (int) (Math.log(bytes) / Math.log(1024)); |
109 char bytePrefix = "kMGTPE".charAt(exp - 1); |
112 char bytePrefix = "kMGTPE".charAt(exp - 1); |