Skip to content

Commit f3bb030

Browse files
committed
fix: low decimal format
1 parent f2e3618 commit f3bb030

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/transactions/Swap/actions/RepayWithCollateral/RepayWithCollateralActionsViaParaswap.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { normalize, normalizeBN, valueToBigNumber } from '@aave/math-utils';
22
import { OrderStatus } from '@cowprotocol/cow-sdk';
33
import { Trans } from '@lingui/macro';
4+
import { BigNumber as BigNumberJS } from 'bignumber.js';
45
import { BigNumber, PopulatedTransaction } from 'ethers';
56
import { Dispatch } from 'react';
67
import { calculateSignedAmount } from 'src/hooks/paraswap/common';
@@ -127,6 +128,7 @@ export const RepayWithCollateralActionsViaParaswap = ({
127128
// Account slippage to make sure we have enough collateral to repay with
128129
repayWithAmount = valueToBigNumber(state.outputAmount || '0')
129130
.multipliedBy(1 + Number(state.slippage) / 100)
131+
.decimalPlaces(state.destinationToken.decimals, BigNumberJS.ROUND_CEIL)
130132
.toFixed(state.destinationToken.decimals);
131133
} else {
132134
// If buy order i want use exactly the collateral to repay with amount

0 commit comments

Comments
 (0)