aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/currency-display.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/send/currency-display.js')
-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))
}