From 60ea5bad4f0656770f5af06f3b06f72a7bb71822 Mon Sep 17 00:00:00 2001 From: Onno Visser <23527729+onnovisser@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:23:02 +0200 Subject: [PATCH] fix validation --- centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx b/centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx index ee249a1a2d..5e5b0ed194 100644 --- a/centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx +++ b/centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx @@ -147,7 +147,7 @@ export function ExternalFinanceForm({ loan }: { loan: LoanType }) { settlementPrice(), (val: any) => { const num = val instanceof Decimal ? val.toNumber() : val - const financeAmount = num * (financeForm.values.faceValue || 1) + const financeAmount = (num * (financeForm.values.faceValue || 1)) / 100 return financeAmount > availableFinancing.toNumber() ? `Amount exceeds available reserve (${formatBalance( @@ -159,7 +159,7 @@ export function ExternalFinanceForm({ loan }: { loan: LoanType }) { }, (val: any) => { const num = val instanceof Decimal ? val.toNumber() : val - const financeAmount = num * (financeForm.values.faceValue || 1) + const financeAmount = (num * (financeForm.values.faceValue || 1)) / 100 return financeAmount > maxBorrow.toNumber() ? `Amount exceeds max borrow (${formatBalance(maxBorrow, pool?.currency.symbol, 2)})` @@ -254,7 +254,7 @@ export function ExternalFinanceForm({ loan }: { loan: LoanType }) { settlementPrice(), (val: any) => { const num = val instanceof Decimal ? val.toNumber() : val - const repayAmount = num * (repayForm.values.faceValue || 1) + const repayAmount = (num * (repayForm.values.faceValue || 1)) / 100 return repayAmount > balance.toNumber() ? `Your wallet balance (${formatBalance( @@ -267,7 +267,7 @@ export function ExternalFinanceForm({ loan }: { loan: LoanType }) { }, (val: any) => { const num = val instanceof Decimal ? val.toNumber() : val - const repayAmount = num * (repayForm.values.faceValue || 1) + const repayAmount = (num * (repayForm.values.faceValue || 1)) / 100 return repayAmount > debt.toNumber() ? 'Amount exceeds outstanding' : '' }