def usage_percent(used, total, _round=None):
 try:
  ret = ((used / total) * 100)
 except ZeroDivisionError:
  ret = (0.0 if (isinstance(used, float) or isinstance(total, float)) else 0)
 if (_round is not None):
  return round(ret, _round)
 else:
  return ret

def usage_percent ( used , total , _round = None ) : try : ret = ( ( used / total ) * 100 ) except ZeroDivisionError : ret = ( 0.0 if ( isinstance ( used , float ) or isinstance ( total , float ) ) else 0 ) if ( _round is not None ) : return round ( ret , _round ) else : return ret
calculate percentage usage of used against total .