diff options
author | Dan <danjm.com@gmail.com> | 2018-06-19 00:20:21 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-06-19 00:20:21 +0800 |
commit | 6c9302f9853d931ecf2f4385fa77b78d367f89e2 (patch) | |
tree | 1398cb2a4a4d557ef873dcf7383dccfc81387dc3 | |
parent | 36de213c6c5eda192d4160d650004523d303379c (diff) | |
download | dexon-wallet-6c9302f9853d931ecf2f4385fa77b78d367f89e2.tar.gz dexon-wallet-6c9302f9853d931ecf2f4385fa77b78d367f89e2.tar.zst dexon-wallet-6c9302f9853d931ecf2f4385fa77b78d367f89e2.zip |
Remove leading zeroes from send screen amount row input.
-rw-r--r-- | ui/app/components/send/currency-display.js | 6 |
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 9866393d..e410bc07 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)) } |