Skip to content

Commit

Permalink
Merge pull request #327 from hubiinetwork/feature/transfer-input-bug
Browse files Browse the repository at this point in the history
Feature/transfer input bug
  • Loading branch information
liamaharon committed Jul 30, 2018
2 parents 20c3ad7 + c75f3b2 commit 92969ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/TransferForm/TransferForm.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ export default class TransferForm extends React.PureComponent {
return;
}

this.setState({ amountToSendInput: formatEthAmount(Number(value)).toFixed(value.length - 2), amountToSend: formatEthAmount(Number(value)) });
if (Number(value).toString().includes('e-')) {
const len = value.length + 2 < 20 ? value.length - 2 : 20;
this.setState({ amountToSendInput: formatEthAmount(Number(value)).toFixed(len) });
} else {
this.setState({ amountToSendInput: formatEthAmount(Number(value)).toString() });
}

this.setState({ amountToSend: formatEthAmount(Number(value)) });
}

handleGasPriceChange(e) {
Expand Down

0 comments on commit 92969ca

Please sign in to comment.