Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Work with string numbers in contract (Fixes #4472) #4478

Merged
merged 1 commit into from
Feb 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions js/src/ui/Form/TypedInput/typedInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ export default class TypedInput extends Component {
renderEth () {
const { ethValue, isEth } = this.state;

const value = ethValue && typeof ethValue.toNumber === 'function'
? ethValue.toNumber()
const value = ethValue && typeof ethValue.toFixed === 'function'
? ethValue.toFixed() // we need a string representation, could be >15 digits
: ethValue;

const input = isEth
Expand Down Expand Up @@ -257,7 +257,7 @@ export default class TypedInput extends Component {

return readOnly
? bnValue.toFormat()
: bnValue.toNumber();
: bnValue.toFixed(); // we need a string representation, could be >15 digits
}

renderInteger (value = this.props.value, onChange = this.onChange) {
Expand Down