aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/conversion-util.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-09-28 22:10:33 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-09-29 06:54:51 +0800
commita195427e7208096f6f873175f2cbdbbb0a802191 (patch)
treeba68423499aa91cfec3bd6e0790d9833fc6848f8 /ui/app/conversion-util.js
parentb55a40c7f144645a29569294996893cb1b519779 (diff)
downloadtangerine-wallet-browser-a195427e7208096f6f873175f2cbdbbb0a802191.tar
tangerine-wallet-browser-a195427e7208096f6f873175f2cbdbbb0a802191.tar.gz
tangerine-wallet-browser-a195427e7208096f6f873175f2cbdbbb0a802191.tar.bz2
tangerine-wallet-browser-a195427e7208096f6f873175f2cbdbbb0a802191.tar.lz
tangerine-wallet-browser-a195427e7208096f6f873175f2cbdbbb0a802191.tar.xz
tangerine-wallet-browser-a195427e7208096f6f873175f2cbdbbb0a802191.tar.zst
tangerine-wallet-browser-a195427e7208096f6f873175f2cbdbbb0a802191.zip
Fix send of USD and backspacing amount to 0
Diffstat (limited to 'ui/app/conversion-util.js')
-rw-r--r--ui/app/conversion-util.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/app/conversion-util.js b/ui/app/conversion-util.js
index 7e02fe2bd..37877d12c 100644
--- a/ui/app/conversion-util.js
+++ b/ui/app/conversion-util.js
@@ -47,7 +47,7 @@ const toNormalizedDenomination = {
WEI: bigNumber => bigNumber.div(BIG_NUMBER_WEI_MULTIPLIER)
}
const toSpecifiedDenomination = {
- WEI: bigNumber => bigNumber.times(BIG_NUMBER_WEI_MULTIPLIER)
+ WEI: bigNumber => bigNumber.times(BIG_NUMBER_WEI_MULTIPLIER).round()
}
const baseChange = {
hex: n => n.toString(16),
@@ -83,8 +83,8 @@ const whenPropApplySetterMap = (prop, setterMap) => whenPredSetWithPropAndSetter
const converter = R.pipe(
whenPropApplySetterMap('fromNumericBase', toBigNumber),
whenPropApplySetterMap('fromDenomination', toNormalizedDenomination),
- whenPropApplySetterMap('toDenomination', toSpecifiedDenomination),
whenPredSetWithPropAndSetter(fromAndToCurrencyPropsNotEqual, 'conversionRate', convert),
+ whenPropApplySetterMap('toDenomination', toSpecifiedDenomination),
whenPredSetWithPropAndSetter(R.prop('ethToUSDRate'), 'ethToUSDRate', convert),
whenPredSetWithPropAndSetter(R.prop('numberOfDecimals'), 'numberOfDecimals', round),
whenPropApplySetterMap('toNumericBase', baseChange),