Remove leading zeroes from send screen amount row input.

This commit is contained in:
Dan 2018-06-18 13:50:21 -02:30
parent 36de213c6c
commit 6c9302f985
1 changed files with 5 additions and 1 deletions

View File

@ -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))
}