diff options
Remove leading zeroes from send screen amount row input.
Diffstat (limited to 'ui')
-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 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)) } |