@Override public String toString() { long bytes = getBytes(); double value = bytes; String suffix = ByteSizeUnit.BYTES.getSuffix(); if (bytes >= ByteSizeUnit.C5) { value = getPbFrac(); suffix = ByteSizeUnit.PB.getSuffix(); } else if (bytes >= ByteSizeUnit.C4) { value = getTbFrac(); suffix = ByteSizeUnit.TB.getSuffix(); } else if (bytes >= ByteSizeUnit.C3) { value = getGbFrac(); suffix = ByteSizeUnit.GB.getSuffix(); } else if (bytes >= ByteSizeUnit.C2) { value = getMbFrac(); suffix = ByteSizeUnit.MB.getSuffix(); } else if (bytes >= ByteSizeUnit.C1) { value = getKbFrac(); suffix = ByteSizeUnit.KB.getSuffix(); } return Strings.format1Decimals(value, suffix); }
@Override public String toString() { long bytes = getBytes(); double value = bytes; String suffix = "b"; if (bytes >= ByteSizeUnit.C5) { value = getPbFrac(); suffix = "pb"; } else if (bytes >= ByteSizeUnit.C4) { value = getTbFrac(); suffix = "tb"; } else if (bytes >= ByteSizeUnit.C3) { value = getGbFrac(); suffix = "gb"; } else if (bytes >= ByteSizeUnit.C2) { value = getMbFrac(); suffix = "mb"; } else if (bytes >= ByteSizeUnit.C1) { value = getKbFrac(); suffix = "kb"; } return Strings.format1Decimals(value, suffix); }
@Override public String toString() { long bytes = getBytes(); double value = bytes; String suffix = ByteSizeUnit.BYTES.getSuffix(); if (bytes >= ByteSizeUnit.C5) { value = getPbFrac(); suffix = ByteSizeUnit.PB.getSuffix(); } else if (bytes >= ByteSizeUnit.C4) { value = getTbFrac(); suffix = ByteSizeUnit.TB.getSuffix(); } else if (bytes >= ByteSizeUnit.C3) { value = getGbFrac(); suffix = ByteSizeUnit.GB.getSuffix(); } else if (bytes >= ByteSizeUnit.C2) { value = getMbFrac(); suffix = ByteSizeUnit.MB.getSuffix(); } else if (bytes >= ByteSizeUnit.C1) { value = getKbFrac(); suffix = ByteSizeUnit.KB.getSuffix(); } return Strings.format1Decimals(value, suffix); }
@Override public String toString() { long bytes = getBytes(); double value = bytes; String suffix = ByteSizeUnit.BYTES.getSuffix(); if (bytes >= ByteSizeUnit.C5) { value = getPbFrac(); suffix = ByteSizeUnit.PB.getSuffix(); } else if (bytes >= ByteSizeUnit.C4) { value = getTbFrac(); suffix = ByteSizeUnit.TB.getSuffix(); } else if (bytes >= ByteSizeUnit.C3) { value = getGbFrac(); suffix = ByteSizeUnit.GB.getSuffix(); } else if (bytes >= ByteSizeUnit.C2) { value = getMbFrac(); suffix = ByteSizeUnit.MB.getSuffix(); } else if (bytes >= ByteSizeUnit.C1) { value = getKbFrac(); suffix = ByteSizeUnit.KB.getSuffix(); } return Strings.format1Decimals(value, suffix); }