pricing/price.py
def amount_converter(obj):
    """Converts amount value from several types into Decimal."""
    if isinstance(obj, Decimal):
        return obj
    elif isinstance(obj, (str, int, float)):
        return Decimal(str(obj))
    else:
        raise ValueError('do not know how to convert: {}'.format(type(obj)))
def amount_converter(obj):
    if isinstance(obj, Decimal):
        return obj
    elif isinstance(obj, (str, int, float)):
        return Decimal(str(obj))
    else:
        raise ValueError('do not know how to convert: {}'.format(type(obj)))
def amount_converter ( obj ) : if isinstance ( obj , Decimal ) : return obj elif isinstance ( obj , ( str , int , float ) ) : return Decimal ( str ( obj ) ) else : raise ValueError ( 'do not know how to convert: {}' . format ( type ( obj ) ) )
Converts amount value from several types into Decimal.
Converts amount value from several types into Decimal .