def discount_ratio(discount):
    """Returns the discount as a ratio, making sure that the percent is under 1"""
    pcnt = discount.percentage
    if pcnt > 1:
        pcnt = pcnt/100

    return 1-pcnt
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/product/templatetags/satchmo_discounts.py/discount_ratio/original