Android Long Readable Format sizeConvert(long size)

Here you can find the source of sizeConvert(long size)

Description

size Convert

Declaration

public static String sizeConvert(long size) 

Method Source Code

//package com.java2s;

public class Main {

    public static String sizeConvert(long size) {
        if (size <= 1024) {
            return "1Kb";
        } else if (size > 1024 && size < 1024 * 1024) {
            return size / 1024 + "Kb";
        } else {//from   www  .  jav  a  2  s. co m
            return size / 1024 / 1024 + "M";
        }
    }
}

Related

  1. byteCountToDisplaySize(long size)
  2. humanReadableByteCount(long bytes)
  3. humanReadableByteCount(long bytes, boolean size)
  4. prettyBytes(long value)
  5. getSizeDesc(long size)
  6. humanReadableByteCount(long bytes, boolean si)
  7. ReadableByteCount(long bytes)