Skip to content

Commit

Permalink
Merge pull request #1375 from thebiggive/DON-921-fix-total-for-PRB-di…
Browse files Browse the repository at this point in the history
…splay

DON-921: Fix wrong rounding for total used in payment request button
  • Loading branch information
bdsl authored Nov 7, 2023
2 parents 3936500 + 908591d commit b894760
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/stripe.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class StripeService {
}

private amountIncTipInMinorUnit(donation: Donation) {
return Math.floor((donation.tipAmount + donation.donationAmount) * 100);
// use round not floor to avoid issues like returning 114 as the sum of £1 and £0.15
return Math.round((donation.tipAmount + donation.donationAmount) * 100);
}
}

0 comments on commit b894760

Please sign in to comment.