diff --git a/components/BorrowForm.tsx b/components/BorrowForm.tsx index a79c8fc3..70ed6c04 100644 --- a/components/BorrowForm.tsx +++ b/components/BorrowForm.tsx @@ -103,7 +103,7 @@ function BorrowForm({ onSuccess, token }: BorrowFormProps) { new Decimal(percentage).div(100).mul(tokenMax), bank.mintDecimals ) - setInputAmount(amount.toString()) + setInputAmount(amount.toFixed()) }, [tokenMax, bank] ) @@ -111,7 +111,7 @@ function BorrowForm({ onSuccess, token }: BorrowFormProps) { const setMax = useCallback(() => { if (!bank) return const max = floorToDecimal(tokenMax, bank.mintDecimals) - setInputAmount(max.toString()) + setInputAmount(max.toFixed()) handleSizePercentage('100') }, [bank, tokenMax, handleSizePercentage]) diff --git a/components/DepositForm.tsx b/components/DepositForm.tsx index 6879b5b1..71505d18 100644 --- a/components/DepositForm.tsx +++ b/components/DepositForm.tsx @@ -126,7 +126,7 @@ function DepositForm({ onSuccess, token }: DepositFormProps) { const setMax = useCallback(() => { const max = floorToDecimal(tokenMax.maxAmount, tokenMax.maxDecimals) - setInputAmount(max.toString()) + setInputAmount(max.toFixed()) setSizePercentage('100') }, [tokenMax]) @@ -137,7 +137,7 @@ function DepositForm({ onSuccess, token }: DepositFormProps) { new Decimal(tokenMax.maxAmount).mul(percentage).div(100), tokenMax.maxDecimals ) - setInputAmount(amount.toString()) + setInputAmount(amount.toFixed()) }, [tokenMax] ) diff --git a/components/RepayForm.tsx b/components/RepayForm.tsx index 05a3e6e9..19e8afae 100644 --- a/components/RepayForm.tsx +++ b/components/RepayForm.tsx @@ -92,7 +92,7 @@ function RepayForm({ onSuccess, token }: RepayFormProps) { bank.mintDecimals, Decimal.ROUND_UP ) - setInputAmount(amount.toString()) + setInputAmount(amount.toFixed()) setSizePercentage('100') }, [bank, borrowAmount]) @@ -105,7 +105,7 @@ function RepayForm({ onSuccess, token }: RepayFormProps) { .div(100) .toDecimalPlaces(bank.mintDecimals, Decimal.ROUND_UP) - setInputAmount(amount.toString()) + setInputAmount(amount.toFixed()) }, [bank, borrowAmount] ) diff --git a/components/WithdrawForm.tsx b/components/WithdrawForm.tsx index d580be91..f117fba3 100644 --- a/components/WithdrawForm.tsx +++ b/components/WithdrawForm.tsx @@ -90,7 +90,7 @@ function WithdrawForm({ onSuccess, token }: WithdrawFormProps) { new Decimal(tokenMax).mul(percentage).div(100), bank.mintDecimals ) - setInputAmount(amount.toString()) + setInputAmount(amount.toFixed()) }, [bank, tokenMax] ) @@ -98,7 +98,7 @@ function WithdrawForm({ onSuccess, token }: WithdrawFormProps) { const setMax = useCallback(() => { if (!bank) return const max = floorToDecimal(tokenMax, bank.mintDecimals) - setInputAmount(max.toString()) + setInputAmount(max.toFixed()) setSizePercentage('100') }, [bank, tokenMax])