aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-10-21 09:57:59 +0800
committerDan <danjm.com@gmail.com>2017-10-24 02:23:28 +0800
commitb3dad510b7119c6bd89afb0059d95a6684402538 (patch)
treebb349d4a9c9437fd4f7b31cc0afba53ad85e7293 /ui/app/components
parent8f3b762461ada222f82089e686a61183dd167428 (diff)
downloadtangerine-wallet-browser-b3dad510b7119c6bd89afb0059d95a6684402538.tar.gz
tangerine-wallet-browser-b3dad510b7119c6bd89afb0059d95a6684402538.tar.zst
tangerine-wallet-browser-b3dad510b7119c6bd89afb0059d95a6684402538.zip
Improve precision in send and confirm.
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/pending-tx/confirm-send-token.js2
-rw-r--r--ui/app/components/send/currency-display.js6
2 files changed, 5 insertions, 3 deletions
diff --git a/ui/app/components/pending-tx/confirm-send-token.js b/ui/app/components/pending-tx/confirm-send-token.js
index a4c3d16e3..cc4c5f5f4 100644
--- a/ui/app/components/pending-tx/confirm-send-token.js
+++ b/ui/app/components/pending-tx/confirm-send-token.js
@@ -224,7 +224,7 @@ ConfirmSendToken.prototype.renderTotalPlusGas = function () {
]),
h('div.confirm-screen-section-column', [
- h('div.confirm-screen-row-info', `${fiatAmount + fiatGas} ${currentCurrency}`),
+ h('div.confirm-screen-row-info', `${addCurrencies(fiatAmount, fiatGas)} ${currentCurrency}`),
h('div.confirm-screen-row-detail', `${addCurrencies(tokenAmount, tokenGas || '0')} ${symbol}`),
]),
])
diff --git a/ui/app/components/send/currency-display.js b/ui/app/components/send/currency-display.js
index 7180b94d3..799e9b56d 100644
--- a/ui/app/components/send/currency-display.js
+++ b/ui/app/components/send/currency-display.js
@@ -2,7 +2,7 @@ const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const Identicon = require('../identicon')
-const { conversionUtil } = require('../../conversion-util')
+const { conversionUtil, multiplyCurrencies } = require('../../conversion-util')
module.exports = CurrencyDisplay
@@ -40,7 +40,9 @@ CurrencyDisplay.prototype.getAmount = function (value) {
const { selectedToken } = this.props
const { decimals } = selectedToken || {}
const multiplier = Math.pow(10, Number(decimals || 0))
- const sendAmount = '0x' + Number(value * multiplier).toString(16)
+
+ const sendAmount = multiplyCurrencies(value, multiplier, {toNumericBase: 'hex'})
+
return selectedToken
? sendAmount
: toHexWei(value)