Remove leading zeroes from send screen amount row input.

feature/default_network_editable
Dan 7 years ago
parent 36de213c6c
commit 6c9302f985
  1. 6
      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))
}

Loading…
Cancel
Save