Android Utililty Methods Long Format

List of utility methods to do Long Format

Description

The list of methods to do Long Format are organized into topic(s).

Method

StringgetDisplayable(long numBytes)
get Displayable
if (numBytes < BYTES_SCALING_FACTOR) {
    return numBytes + " bytes";
String label;
double size = ((double) numBytes) / BYTES_SCALING_FACTOR;
if (size < BYTES_SCALING_FACTOR) {
    label = "Kb";
} else {
...
StringformatByte(long l)
format Byte
String s = "0 KB";
if (l <= 0x100000L) {
    BigDecimal bigdecimal = new BigDecimal(l);
    BigDecimal bigdecimal1 = new BigDecimal(1024);
    RoundingMode roundingmode = RoundingMode.CEILING;
    String s1 = String.valueOf(bigdecimal.divide(bigdecimal1, 0,
            roundingmode).toString());
    s = (new StringBuilder(s1)).append(" KB").toString();
...
StringformatFromSize(long size)
format From Size
if (size == -1)
    return "";
String suffix = " B";
if (size >= 1024) {
    suffix = " KB";
    size /= 1024;
    if (size >= 1024) {
        suffix = " MB";
...