aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-11-10 18:37:53 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-11-11 06:12:26 +0800
commit5a0126f17b3513fa7fa1513f2c52abff19535ac0 (patch)
tree4c1acb9063511a0e6d03c5774e5e1a78d4de131b
parent5120cfdff3047e4bf88cec544895cc713d063cdd (diff)
downloadtangerine-wallet-browser-5a0126f17b3513fa7fa1513f2c52abff19535ac0.tar
tangerine-wallet-browser-5a0126f17b3513fa7fa1513f2c52abff19535ac0.tar.gz
tangerine-wallet-browser-5a0126f17b3513fa7fa1513f2c52abff19535ac0.tar.bz2
tangerine-wallet-browser-5a0126f17b3513fa7fa1513f2c52abff19535ac0.tar.lz
tangerine-wallet-browser-5a0126f17b3513fa7fa1513f2c52abff19535ac0.tar.xz
tangerine-wallet-browser-5a0126f17b3513fa7fa1513f2c52abff19535ac0.tar.zst
tangerine-wallet-browser-5a0126f17b3513fa7fa1513f2c52abff19535ac0.zip
Rounding of vals < 0.01 in currency display consistent with master.
-rw-r--r--ui/app/components/send/currency-display.js3
-rw-r--r--ui/app/conversion-util.js2
2 files changed, 3 insertions, 2 deletions
diff --git a/ui/app/components/send/currency-display.js b/ui/app/components/send/currency-display.js
index 870fbb42a..5057c413c 100644
--- a/ui/app/components/send/currency-display.js
+++ b/ui/app/components/send/currency-display.js
@@ -68,13 +68,14 @@ CurrencyDisplay.prototype.render = function () {
const valueToRender = this.getValueToRender()
- const convertedValue = conversionUtil(valueToRender, {
+ let convertedValue = conversionUtil(valueToRender, {
fromNumericBase: 'dec',
fromCurrency: primaryCurrency,
toCurrency: convertedCurrency,
numberOfDecimals: 2,
conversionRate,
})
+ convertedValue = Number(convertedValue).toFixed(2)
return h('div', {
className,
diff --git a/ui/app/conversion-util.js b/ui/app/conversion-util.js
index de37bd595..ee42ebea1 100644
--- a/ui/app/conversion-util.js
+++ b/ui/app/conversion-util.js
@@ -37,7 +37,7 @@ const BIG_NUMBER_GWEI_MULTIPLIER = new BigNumber('1000000000')
// Individual Setters
const convert = R.invoker(1, 'times')
-const round = R.invoker(2, 'round')(R.__, BigNumber.ROUND_DOWN)
+const round = R.invoker(2, 'round')(R.__, BigNumber.ROUND_HALF_DOWN)
const invertConversionRate = conversionRate => () => new BigNumber(1.0).div(conversionRate)
const decToBigNumberViaString = n => R.pipe(String, toBigNumber['dec'])