#NEWLINE# @ classmethod #NEWLINE# def _sanitize( cls , amount ) : #NEWLINE# #INDENT# if isinstance ( amount , cls ) : #NEWLINE# #INDENT# return amount #NEWLINE# #UNINDENT# quant = ( Decimal ( '0.1' ) ** cls . DECIMAL_PLACES ) #NEWLINE# return _to_decimal ( amount ) . quantize ( quant , rounding = ROUND_HALF_UP )