|
|
@ -78,8 +78,13 @@ export default class TokenInput extends PureComponent { |
|
|
|
handleChange = (decimalValue) => { |
|
|
|
handleChange = (decimalValue) => { |
|
|
|
const { token: { decimals } = {}, onChange } = this.props; |
|
|
|
const { token: { decimals } = {}, onChange } = this.props; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let newDecimalValue = decimalValue; |
|
|
|
|
|
|
|
if (decimals) { |
|
|
|
|
|
|
|
newDecimalValue = parseFloat(decimalValue).toFixed(decimals); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const multiplier = Math.pow(10, Number(decimals || 0)); |
|
|
|
const multiplier = Math.pow(10, Number(decimals || 0)); |
|
|
|
const hexValue = multiplyCurrencies(decimalValue || 0, multiplier, { |
|
|
|
const hexValue = multiplyCurrencies(newDecimalValue || 0, multiplier, { |
|
|
|
multiplicandBase: 10, |
|
|
|
multiplicandBase: 10, |
|
|
|
multiplierBase: 10, |
|
|
|
multiplierBase: 10, |
|
|
|
toNumericBase: 'hex', |
|
|
|
toNumericBase: 'hex', |
|
|
|