From 0021006588d6287d6e82658abe2be59a88f0e4d3 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Sun, 25 Aug 2019 18:28:46 +0300 Subject: [PATCH 1/2] Fixed transaction nan value --- .../transaction/view/transactionView.js | 4 +-- src/utils/wallet.js | 28 +++++++++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/components/transaction/view/transactionView.js b/src/components/transaction/view/transactionView.js index 07a1c88a4..ee0fc93a5 100644 --- a/src/components/transaction/view/transactionView.js +++ b/src/components/transaction/view/transactionView.js @@ -56,7 +56,7 @@ class TransactionView extends PureComponent { const transactionData = groomingTransactionData(item, steemPerMVests, formatNumber); if (transactionData.length === 0) return null; - const value = transactionData.value.split(' '); + const value = transactionData.value.trim().split(' '); return ( 0 ? `${sbdPayout} SBD` : ''} ${ steemPayout > 0 ? `${steemPayout} steemPayout` : '' @@ -56,11 +62,17 @@ export const groomingTransactionData = (transaction, steemPerMVests, formatNumbe case 'claim_reward_balance': let { reward_sbd: rewardSdb, reward_steem: rewardSteem, reward_vests: rewardVests } = opData; - rewardSdb = formatNumber(parseToken(rewardSdb), { minimumFractionDigits: 3 }); - rewardSteem = formatNumber(parseToken(rewardSteem), { minimumFractionDigits: 3 }); + rewardSdb = formatNumber(parseToken(rewardSdb), { minimumFractionDigits: 3 }).replace( + ',', + '.', + ); + rewardSteem = formatNumber(parseToken(rewardSteem), { minimumFractionDigits: 3 }).replace( + ',', + '.', + ); rewardVests = formatNumber(vestsToSp(parseToken(rewardVests), steemPerMVests), { minimumFractionDigits: 3, - }); + }).replace(',', '.'); result.value = `${rewardSdb > 0 ? `${rewardSdb} SBD` : ''} ${ rewardSteem > 0 ? `${rewardSteem} STEEM` : '' @@ -82,7 +94,7 @@ export const groomingTransactionData = (transaction, steemPerMVests, formatNumbe opVestingShares = parseToken(opVestingShares); result.value = `${formatNumber(vestsToSp(opVestingShares, steemPerMVests), { minimumFractionDigits: 3, - })} SP`; + }).replace(',', '.')} SP`; result.icon = 'attach-money'; result.details = acc ? `@${acc}` : null; break; From d3a7ade11ad9589c77cfe31a619a0746e8da76d7 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Sun, 25 Aug 2019 22:03:05 +0300 Subject: [PATCH 2/2] Update src/components/transaction/view/transactionView.js --- src/components/transaction/view/transactionView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/transaction/view/transactionView.js b/src/components/transaction/view/transactionView.js index ee0fc93a5..93cdcc75f 100644 --- a/src/components/transaction/view/transactionView.js +++ b/src/components/transaction/view/transactionView.js @@ -85,7 +85,7 @@ class TransactionView extends PureComponent { {(get(transactionData, 'details') || get(transactionData, 'memo')) && (