Skip to content

Commit

Permalink
convert precision
Browse files Browse the repository at this point in the history
  • Loading branch information
kaladinlight committed Aug 21, 2024
1 parent 71dcb9e commit 49e015e
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ export const ClaimConfirm: React.FC<ClaimConfirmProps> = ({
)

const amountCryptoPrecision = useMemo(() => {
return fromBaseUnit(activeClaim.amountCryptoBaseUnit, destinationAsset?.precision ?? 0)
}, [activeClaim.amountCryptoBaseUnit, destinationAsset])
return convertPrecision({
value: fromBaseUnit(activeClaim.amountCryptoBaseUnit, asset?.precision ?? 0),
inputExponent: asset?.precision,
outputExponent: destinationAsset?.precision,
}).toFixed()
}, [activeClaim.amountCryptoBaseUnit, asset, destinationAsset])

const amountUserCurrency = useMemo(() => {
const price =
Expand Down

0 comments on commit 49e015e

Please sign in to comment.