Skip to content

Commit

Permalink
fix amount
Browse files Browse the repository at this point in the history
  • Loading branch information
onnovisser committed Oct 16, 2024
1 parent 127d259 commit faa376d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions centrifuge-app/src/pages/Loan/CorrectionForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ActiveLoan, CurrencyBalance, Pool, Price } from '@centrifuge/centrifuge-js'
import { useCentrifugeApi, useCentrifugeTransaction, wrapProxyCallsForAccount } from '@centrifuge/centrifuge-react'
import { Button, CurrencyInput, Shelf, Stack, Text, TextInput } from '@centrifuge/fabric'
import BN from 'bn.js'
import Decimal from 'decimal.js-light'
import { Field, FieldProps, Form, FormikProvider, useFormik } from 'formik'
import * as React from 'react'
Expand Down Expand Up @@ -43,9 +42,8 @@ export function CorrectionForm({ loan }: { loan: ActiveLoan }) {
const oldQuantity = loan.pricing.outstandingQuantity
const price = CurrencyBalance.fromFloat(values.price, pool.currency.decimals)
const quantity = Price.fromFloat(values.quantity)
const amount = new CurrencyBalance(price.mul(new BN(quantity.toDecimal().toString())), pool.currency.decimals)
isIncrease = oldQuantity.lt(quantity)
const diff = amount.sub(oldQuantity)
const diff = quantity.sub(oldQuantity)
principal = {
external: {
price: price.toString(),
Expand Down

0 comments on commit faa376d

Please sign in to comment.