fix: exchange rate display in transaction card

This commit is contained in:
Sérgio Salgado 2022-11-30 18:58:56 +00:00
parent ef8ad829d2
commit 6d4f3b0f06

View file

@ -125,7 +125,9 @@ const DetailsRow = ({ it: tx, timezone }) => {
const commissionPercentage =
Number.parseFloat(tx.commissionPercentage, 2) * 100
const cashInFee = isCashIn ? Number.parseFloat(tx.cashInFee) : 0
const fiat = Number.parseFloat(tx.fiat)
const fiat = BigNumber(tx.fiat)
.minus(cashInFee)
.toFixed(2, 1) // ROUND_DOWN
const crypto = getCryptoAmount(tx)
const exchangeRate = (fiat / crypto).toFixed(2)
const displayExRate = `1 ${tx.cryptoCode} = ${exchangeRate} ${tx.fiatCode}`