def formatFileSize(size):
 if (size < 1024):
  return ('%iB' % size)
 elif (size < (1024 ** 2)):
  return ('%iK' % (size / 1024))
 elif (size < (1024 ** 3)):
  return ('%iM' % (size / (1024 ** 2)))
 else:
  return ('%iG' % (size / (1024 ** 3)))

def formatFileSize ( size ) : if ( size < 1024 ) : return ( '%iB' % size ) elif ( size < ( 1024 ** 2 ) ) : return ( '%iK' % ( size / 1024 ) ) elif ( size < ( 1024 ** 3 ) ) : return ( '%iM' % ( size / ( 1024 ** 2 ) ) ) else : return ( '%iG' % ( size / ( 1024 ** 3 ) ) )
format the given file size in bytes to human readable format .