Skip to content

Commit

Permalink
Merge pull request #53901 from mkzie2/mkzie2-issue/52310
Browse files Browse the repository at this point in the history
Fix The sum of splits must equal the total amount error is displayed
  • Loading branch information
arosiclair authored Jan 6, 2025
2 parents dbd8518 + d23e6d2 commit 0a304ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/IOUUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function calculateAmount(numberOfParticipants: number, total: number, currency:
// Since the backend can maximum store 2 decimal places, any currency with more than 2 decimals
// has to be capped to 2 decimal places
const currencyUnit = Math.min(100, CurrencyUtils.getCurrencyUnit(currency));
const totalInCurrencySubunit = Math.round((total / 100) * currencyUnit);
const totalInCurrencySubunit = (total / 100) * currencyUnit;
const totalParticipants = numberOfParticipants + 1;
const amountPerPerson = Math.round(totalInCurrencySubunit / totalParticipants);
let finalAmount = amountPerPerson;
Expand Down

0 comments on commit 0a304ce

Please sign in to comment.