code: public static String getApproximateSize(long size) {
  		if(size==1) return "1 byte";
  		if(size<1024) return new StringBuilder().append((int)size).append(" bytes").toString();
  		String unitName;
  		long unitSize;
  		if(size<(1024*1024)) {
  			unitName=" k";
  			unitSize=1024;
  		} else if(size<((long)1024*1024*1024)) {
  			unitName=" M";
  			unitSize=1024*1024;
  		} else if(size<((long)1024*1024*1024*1024)) {
  			unitName=" G";
  			unitSize=(long)1024*1024*1024;
  		} else {
  			unitName=" T";
  			unitSize=(long)1024*1024*1024*1024;
  		}
  		long whole=size/unitSize;
  		if(whole<100) {
  			int fraction=(int)(((size%unitSize)*10)/unitSize);
  			return new StringBuilder().append(whole).append('.').append(fraction).append(unitName).toString();
  		} else return new StringBuilder().append(whole).append(unitName).toString();
  	}
docs: Gets the approximate size (where k=1024) of a file in this format:
  
  x byte(s)
  xx bytes
  xxx bytes
  x.x k
  xx.x k
  xxx k
  x.x M
  xx.x M
  xxx M
  x.x G
  xx.x G
  xxx G
  x.x T
  xx.x T
  xxx T
  xxx... T