def do_round(value, precision=0, method='common'):
 if (not (method in ('common', 'ceil', 'floor'))):
  raise FilterArgumentError('method must be common, ceil or floor')
 if (method == 'common'):
  return round(value, precision)
 func = getattr(math, method)
 return (func((value * (10 ** precision))) / (10 ** precision))

def do_round ( value , precision = 0 , method = 'common' ) : if ( not ( method in ( 'common' , 'ceil' , 'floor' ) ) ) : raise FilterArgumentError ( 'method must be common, ceil or floor' ) if ( method == 'common' ) : return round ( value , precision ) func = getattr ( math , method ) return ( func ( ( value * ( 10 ** precision ) ) ) / ( 10 ** precision ) )
round the number to a given precision .