#NEWLINE# def fn_round( xc , p , contextItem , args ) : #NEWLINE# #INDENT# if ( len ( args ) != 1 ) : #NEWLINE# #INDENT# raise XPathContext . FunctionNumArgs ( ) #NEWLINE# #UNINDENT# x = numericArg ( xc , p , args ) #NEWLINE# if ( math . isinf ( x ) or math . isnan ( x ) ) : #NEWLINE# #INDENT# return x #NEWLINE# #UNINDENT# return _INT ( ( x + ( DECIMAL_5 if isinstance ( x , Decimal ) else 0.5 ) ) )