fix: rounding the total amount the pending and matched transactions

This commit is contained in:
Ahmed Bouhuolia
2024-08-12 13:01:00 +02:00
parent 0a78d56015
commit c928940d32
2 changed files with 4 additions and 4 deletions

View File

@@ -1,8 +1,8 @@
import { useMemo } from 'react';
import { useFormikContext } from 'formik';
import { round } from 'lodash';
import { MatchingTransactionFormValues } from './types';
import { useMatchingTransactionBoot } from './MatchingTransactionBoot';
import { useCategorizeTransactionTabsBoot } from './CategorizeTransactionTabsBoot';
import { useMemo } from 'react';
export const transformToReq = (
values: MatchingTransactionFormValues,
@@ -38,7 +38,7 @@ export const useGetPendingAmountMatched = () => {
);
const pendingAmount = totalPending - totalMatchedAmount;
return pendingAmount;
return round(pendingAmount, 2);
}, [totalPending, perfectMatches, possibleMatches, values]);
};