Update size abbreviations e.g. from kb, mb, to KiB, MiB (#212)
This commit is contained in:
parent
a2fc44aced
commit
5912eb9c8a
@ -367,13 +367,13 @@ public class Utils {
|
|||||||
|
|
||||||
public static String bytesToHumanReadable(int bytes) {
|
public static String bytesToHumanReadable(int bytes) {
|
||||||
float fbytes = (float) bytes;
|
float fbytes = (float) bytes;
|
||||||
String[] mags = new String[] {"", "k", "m", "g", "t"};
|
String[] mags = new String[] {"", "K", "M", "G", "T"};
|
||||||
int magIndex = 0;
|
int magIndex = 0;
|
||||||
while (fbytes >= 1024) {
|
while (fbytes >= 1024) {
|
||||||
fbytes /= 1024;
|
fbytes /= 1024;
|
||||||
magIndex++;
|
magIndex++;
|
||||||
}
|
}
|
||||||
return String.format("%.2f%sb", fbytes, mags[magIndex]);
|
return String.format("%.2f%siB", fbytes, mags[magIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<String> getListOfAlbumRippers() throws Exception {
|
public static List<String> getListOfAlbumRippers() throws Exception {
|
||||||
|
Loading…
Reference in New Issue
Block a user