aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-19 00:20:21 +0800
committerDan <danjm.com@gmail.com>2018-06-19 00:20:21 +0800
commit6c9302f9853d931ecf2f4385fa77b78d367f89e2 (patch)
tree1398cb2a4a4d557ef873dcf7383dccfc81387dc3 /ui
parent36de213c6c5eda192d4160d650004523d303379c (diff)
downloadtangerine-wallet-browser-6c9302f9853d931ecf2f4385fa77b78d367f89e2.tar
tangerine-wallet-browser-6c9302f9853d931ecf2f4385fa77b78d367f89e2.tar.gz
tangerine-wallet-browser-6c9302f9853d931ecf2f4385fa77b78d367f89e2.tar.bz2
tangerine-wallet-browser-6c9302f9853d931ecf2f4385fa77b78d367f89e2.tar.lz
tangerine-wallet-browser-6c9302f9853d931ecf2f4385fa77b78d367f89e2.tar.xz
tangerine-wallet-browser-6c9302f9853d931ecf2f4385fa77b78d367f89e2.tar.zst
tangerine-wallet-browser-6c9302f9853d931ecf2f4385fa77b78d367f89e2.zip
Remove leading zeroes from send screen amount row input.
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/send/currency-display.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/app/components/send/currency-display.js b/ui/app/components/send/currency-display.js
index 9866393d8..e410bc070 100644
--- a/ui/app/components/send/currency-display.js
+++ b/ui/app/components/send/currency-display.js
@@ -92,8 +92,12 @@ CurrencyDisplay.prototype.getConvertedValueToRender = function (nonFormattedValu
: convertedValue
}
+function removeLeadingZeroes (str) {
+ return str.replace(/^0*(?=\d)/, '')
+}
+
CurrencyDisplay.prototype.handleChange = function (newVal) {
- this.setState({ valueToRender: newVal })
+ this.setState({ valueToRender: removeLeadingZeroes(newVal) })
this.props.onChange(this.getAmount(newVal))
}