code: public String castToPrintableMessage(long number) {
          long i = number / 1048576;
          if (i > 0)
              return String.valueOf(i) + " MB";
  
          else {
              long l = number / 1024;
              return String.valueOf(l) + " KB";
          }
  
      }
docs: Casts a long to MB or KB
  
  @param number long number to cast
  @return number in MB or KB if less than 1048576