public static String toKilobytes(long bytes){
  if (bytes < 0)   return "? " + GENERAL_UNIT_KILOBYTES;
  long kbytes=bytes / 1024;
  if ((bytes & 512) != 0 || (bytes > 0 && bytes < 1024))   kbytes++;
  return NUMBER_FORMAT0.format(kbytes) + GENERAL_UNIT_KILOBYTES;
}

public static String toKilobytes ( long bytes ) { if ( bytes < 0 ) return "? " + GENERAL_UNIT_KILOBYTES ; long kbytes = bytes / 1024 ; if ( ( bytes & 512 ) != 0 || ( bytes > 0 && bytes < 1024 ) ) kbytes ++ ; return NUMBER_FORMAT0 . format ( kbytes ) + GENERAL_UNIT_KILOBYTES ; }
this static method converts the passed in number of bytes into a kilobyte string grouping digits with locale - dependant thousand separator and with " kb " locale - dependant unit at the end .
