From d91f403c8d71862ebe48b452df3b4b4579c8ac07 Mon Sep 17 00:00:00 2001 From: apane Date: Fri, 24 Apr 2020 10:50:38 -0300 Subject: [PATCH] Uses formatAmount --- .../safe/components/Transactions/TxsTable/columns.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/routes/safe/components/Transactions/TxsTable/columns.js b/src/routes/safe/components/Transactions/TxsTable/columns.js index 81867b10..925d6bc0 100644 --- a/src/routes/safe/components/Transactions/TxsTable/columns.js +++ b/src/routes/safe/components/Transactions/TxsTable/columns.js @@ -8,6 +8,7 @@ import TxType from './TxType' import { type Column } from '~/components/Table/TableHead' import { type SortRow, buildOrderFieldFrom } from '~/components/Table/sorting' +import { formatAmount } from '~/logic/tokens/utils/formatAmount' import { getWeb3 } from '~/logic/wallets/getWeb3' import { INCOMING_TX_TYPES, type IncomingTransaction } from '~/routes/safe/store/models/incomingTransaction' import { type Transaction } from '~/routes/safe/store/models/transaction' @@ -46,7 +47,11 @@ export const getTxAmount = (tx: Transaction) => { if (tx.isTokenTransfer && tx.decodedParams) { const tokenDecimals = tx.decimals.toNumber ? tx.decimals.toNumber() : tx.decimals - txAmount = `${new BigNumber(tx.decodedParams.value).div(10 ** tokenDecimals).toFixed()} ${tx.symbol}` + txAmount = `${formatAmount( + BigNumber(tx.decodedParams.value) + .div(10 ** tokenDecimals) + .toString(), + )} ${tx.symbol}` } else if (Number(tx.value) > 0) { txAmount = `${fromWei(toBN(tx.value), 'ether')} ${tx.symbol}` }