def _fmtSize(self, size=None):
    ''' Format a number of bytes into a human readable string '''
    if size and type(size) in [types.IntType, types.LongType]:
      if size < 1024:
        return '%dB' % size
      elif size > 1024 and size < (1024**2):
        return '%4.02fKB' % (float(size) / 1024.00)
      elif size > (1024**2) and size < (1024**3):
        return '%4.02fMB' % ((float(size) / 1024.00) / 1024.00)
      else:
        return '%.02fGB' % (((float(size) / 1024.00) / 1024.00) / 1024.00)
 Format a number of bytes into a human readable string 
recipes/Python/578531_carpy_Ctypes_ARchiver_PYthlibarchive_ffi/recipe-578531.py