Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid character in purchase form #2466

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export function ExternalFinanceForm({ loan, source }: { loan: ExternalLoan; sour
if (source === 'reserve') {
financeTx = cent.pools.financeExternalLoan([poolId, loanId, quantity, price], { batch: true })
} else {
const principal = new CurrencyBalance(
price.mul(new BN(quantity.toDecimal().toString())),
const principal = CurrencyBalance.fromFloat(
price.toDecimal().mul(quantity.toDecimal()).toString(),
pool.currency.decimals
)
const repay = { principal, interest: new BN(0), unscheduled: new BN(0) }
Expand Down Expand Up @@ -93,7 +93,7 @@ export function ExternalFinanceForm({ loan, source }: { loan: ExternalLoan; sour
},
onSubmit: (values, actions) => {
const price = CurrencyBalance.fromFloat(values.price.toString(), pool.currency.decimals)
const quantity = Price.fromFloat(values.quantity)
const quantity = Price.fromFloat(values.quantity.toString())
doFinanceTransaction([loan.poolId, loan.id, quantity, price], {
account,
})
Expand Down
Loading