Merge pull request #1462 from chaotixkilla/fix-wrong-exchange-rate-display

Fix exchange rate display
This commit is contained in:
Rafael Taranto 2022-12-05 22:35:27 +00:00 committed by GitHub
commit 9c30357517

View file

@ -125,9 +125,13 @@ 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 exchangeRate = BigNumber(fiat)
.div(crypto)
.toFixed(2, 1) // ROUND_DOWN
const displayExRate = `1 ${tx.cryptoCode} = ${exchangeRate} ${tx.fiatCode}`
const discount = tx.discount ? `-${tx.discount}%` : null