Skip to content

Commit

Permalink
Solved bug listed in web3#2184. Now, it properly converts the hex val…
Browse files Browse the repository at this point in the history
…ue to number string. Also, solved a similar bug on line 271.
  • Loading branch information
princesinha19 committed Mar 26, 2019
1 parent 2d8a0b1 commit b5536bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/web3-utils/src/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export const hexToNumber = (value) => {
return value;
}

return toBN(value).toNumber();
return parseInt(value, 16);
};

/**
Expand All @@ -283,7 +283,7 @@ export const hexToNumber = (value) => {
export const hexToNumberString = (value) => {
if (!value) return value;

return toBN(value).toString(10);
return parseInt(value, 16).toString();
};

/**
Expand Down

0 comments on commit b5536bd

Please sign in to comment.