Fix math error in computing discount