#NEWLINE# def _normalize_quantity( self , quantity = None ) : #NEWLINE# #INDENT# if ( quantity is not None ) : #NEWLINE# #INDENT# quantity = Decimal ( quantity ) #NEWLINE# quantity = quantity . quantize ( Decimal ( '.0001' ) ) #NEWLINE# #UNINDENT# return quantity