code: static public String serializeNumber(final long number) throws NumberFormatException
     {
        if ((number >= 1099511627776l) && (number % 1099511627776l) == 0)
        {
           return String.valueOf(number / 1099511627776l) + "TB";
        }
        else if ((number >= 1073741824l) && (number % 1073741824l) == 0)
        {
           return String.valueOf(number / 1073741824l) + "GB";
        }
        else if ((number >= 1048576l) && (number % 1048576l) == 0)
        {
           return String.valueOf(number / 1048576l) + "MB";
        }
        
        else if ((number >= 1024l) && (number % 1024l) == 0)
        {
           return String.valueOf(number / 1024l) + "KB";
        }
        else
        {
           return String.valueOf(number);
        }
     }
docs: Serialize given number to text as number representation. <br>
  
  <br>E.g. 2048 number will be returned as 2kb.
  
  <br>Next formats are supported: <br>kilobytes - k,kb <br>megabytes - m,mb
  <br>gigabytes - g,gb <br>terabytes - t,tb
  
  @param number
  - long
  @return String
  - number representation
  @throws NumberFormatException