Skip to content

Commit

Permalink
fix: split evenly precision fix for decimals (#2767)
Browse files Browse the repository at this point in the history
  • Loading branch information
suyashpatil78 committed Feb 20, 2024
1 parent 711bc92 commit 9106353
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/fyle/split-expense/split-expense.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ export class SplitExpensePage {
// Last split should have the remaining amount after even split to make sure we get the total amount

const evenlySplitTotalAmount = parseFloat((evenAmount * lastSplitIndex).toPrecision(15));
const lastSplitAmount = parseFloat((this.amount - evenlySplitTotalAmount).toPrecision(15));
const lastSplitAmount = parseFloat((this.amount - evenlySplitTotalAmount).toFixed(7));
const lastSplitPercentage = parseFloat((100 - evenPercentage * lastSplitIndex).toFixed(3));

this.setEvenSplit(evenAmount, evenPercentage, lastSplitAmount, lastSplitPercentage);
Expand Down

0 comments on commit 9106353

Please sign in to comment.