code: public static String formatBytesHumanReadable(long _bytes, boolean _use1000BytesPerMb) {
          int unit = _use1000BytesPerMb ? 1000 : 1024;
          if (_bytes < unit)  {
              return _bytes + " B";
          }
          int exp = (int) (Math.log(_bytes) / Math.log(unit));
          String pre = (_use1000BytesPerMb ? "kMGTPE" : "KMGTPE").charAt(exp-1) + (_use1000BytesPerMb ? "" : "i");
          return String.format("%.1f %sB", _bytes / Math.pow(unit, exp), pre);
      }
docs: Formats a file size given in byte to something human readable.
  
  @param _bytes size in bytes
  @param _use1000BytesPerMb use 1000 bytes per MByte instead of 1024
  @return String