aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pages
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-07-27 03:15:34 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-07-28 03:22:10 +0800
commitd0c901d081e3b40a191dcb826fda7925d16df92c (patch)
tree13b8b5a75531f0bec35118bc5747ad39fe90c03a /ui/app/components/pages
parentcd2b67cdd956cd7f2a29f94292939a4bb939b7b3 (diff)
downloadtangerine-wallet-browser-d0c901d081e3b40a191dcb826fda7925d16df92c.tar.gz
tangerine-wallet-browser-d0c901d081e3b40a191dcb826fda7925d16df92c.tar.zst
tangerine-wallet-browser-d0c901d081e3b40a191dcb826fda7925d16df92c.zip
Round large exponential numbers
Diffstat (limited to 'ui/app/components/pages')
-rw-r--r--ui/app/components/pages/confirm-token-transaction-base/confirm-token-transaction-base.component.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/app/components/pages/confirm-token-transaction-base/confirm-token-transaction-base.component.js b/ui/app/components/pages/confirm-token-transaction-base/confirm-token-transaction-base.component.js
index 365ae216e..acaed383a 100644
--- a/ui/app/components/pages/confirm-token-transaction-base/confirm-token-transaction-base.component.js
+++ b/ui/app/components/pages/confirm-token-transaction-base/confirm-token-transaction-base.component.js
@@ -5,6 +5,7 @@ import {
formatCurrency,
convertTokenToFiat,
addFiat,
+ roundExponential,
} from '../../../helpers/confirm-transaction/util'
export default class ConfirmTokenTransactionBase extends Component {
@@ -42,7 +43,8 @@ export default class ConfirmTokenTransactionBase extends Component {
return this.context.t('noConversionRateAvailable')
} else {
const fiatTransactionAmount = this.getFiatTransactionAmount()
- return formatCurrency(fiatTransactionAmount, currentCurrency)
+ const roundedFiatTransactionAmount = roundExponential(fiatTransactionAmount)
+ return formatCurrency(roundedFiatTransactionAmount, currentCurrency)
}
}
@@ -54,7 +56,8 @@ export default class ConfirmTokenTransactionBase extends Component {
} else {
const fiatTransactionAmount = this.getFiatTransactionAmount()
const fiatTotal = addFiat(fiatTransactionAmount, fiatTransactionTotal)
- return formatCurrency(fiatTotal, currentCurrency)
+ const roundedFiatTotal = roundExponential(fiatTotal)
+ return formatCurrency(roundedFiatTotal, currentCurrency)
}
}