Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web3.utils.hexToNumber wrong result #1677

Closed
IamBlockMan opened this issue Jun 4, 2018 · 4 comments
Closed

Web3.utils.hexToNumber wrong result #1677

IamBlockMan opened this issue Jun 4, 2018 · 4 comments
Assignees
Labels
1.x 1.0 related issues Bug Addressing a bug

Comments

@IamBlockMan
Copy link

When I try to convert hex to number at the value

Web3.utils.hexToNumber("0000000000000000000000000000000000000000000000000000000000000010");

I got:

10

It should be 16 for the correct convert.

@nivida nivida self-assigned this Aug 10, 2018
@nivida nivida added the Bug Addressing a bug label Aug 10, 2018
@nivida
Copy link
Contributor

nivida commented Aug 13, 2018

Depends on: https://github.com/SilentCicero/number-to-bn

I'm in contact with Nick Dodson.

@nivida nivida added the On Ice Important but no longer pursued for the near future label Aug 13, 2018
@ripern
Copy link

ripern commented Sep 18, 2018

This is still broken. https://github.com/SilentCicero/number-to-bn has not changed in 2 years. Any alternative?

@nivida
Copy link
Contributor

nivida commented Jan 22, 2019

Will check if there is a similar module which is maintained. Otherwise, I will implement it on my own. @ripern

@nivida nivida added the 1.x 1.0 related issues label Jun 20, 2019
@nivida nivida removed the On Ice Important but no longer pursued for the near future label Oct 23, 2019
@nivida
Copy link
Contributor

nivida commented Oct 31, 2019

This got already fixed in v1.2.2.

Example:

console.log(utils.hexToNumber("0x0000000000000000000000000000000000000000000000000000000000000010"));
> 16

@nivida nivida closed this as completed Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Bug Addressing a bug
Projects
None yet
Development

No branches or pull requests

3 participants