Skip to content

Commit

Permalink
Fixing calculation of match_amount in Subscription (#9859)
Browse files Browse the repository at this point in the history
  • Loading branch information
nutrina authored Dec 8, 2021
1 parent b28ac57 commit cf4cf6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/grants/models/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ def match_amount(self):
y_lower = clr_prediction_curve[4]
y_upper = clr_prediction_curve[5]

# use lerp to discover the predicted match_amount
return y_lower + (((y_upper - y_lower) * (float(amount) - x_lower)) / (x_upper - x_lower))
# use lerp to discover the predicted match_amount
predicted_clr = y_lower + (((y_upper - y_lower) * (float(amount) - x_lower)) / (x_upper - x_lower))

return predicted_clr

@property
def match_amount_token(self):
Expand Down

0 comments on commit cf4cf6a

Please sign in to comment.