Refactoring

This commit is contained in:
M66B
2020-07-02 10:19:01 +02:00
parent f3f80b46c0
commit 0d56d9f79d
12 changed files with 27 additions and 22 deletions

View File

@@ -697,7 +697,11 @@ public class Helper {
private static final DecimalFormat df = new DecimalFormat("@@");
static String humanReadableByteCount(long bytes, boolean si) {
static String humanReadableByteCount(long bytes) {
return humanReadableByteCount(bytes, true);
}
private static String humanReadableByteCount(long bytes, boolean si) {
int unit = si ? 1000 : 1024;
if (bytes < unit) return bytes + " B";
int exp = (int) (Math.log(bytes) / Math.log(unit));