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

Wrong doc about the result of "new BN('0xea').toString();" #3762

Closed
hihidev opened this issue Oct 24, 2020 · 3 comments
Closed

Wrong doc about the result of "new BN('0xea').toString();" #3762

hihidev opened this issue Oct 24, 2020 · 3 comments
Labels
Bug Addressing a bug Documentation Relates to project wiki or documentation Good First Issue Great to learn the internals of web3.js Stale Has not received enough activity

Comments

@hihidev
Copy link

hihidev commented Oct 24, 2020

Following
https://web3js.readthedocs.io/en/v1.3.0/web3-utils.html?highlight=BN#bn

Run:
new BN('0xea').toString();

Expected behavior

"234"

Actual behavior

"3450"

PS: web3.utils.toBN('0xea') returns "234" correctly

@jdevassi
Copy link

When removing the single quotation marks -> expected behaviour.

On:
new BN(0xea).toString();

We get:
234

Same (previous comment's) conditions and results when using 'bn.js' directly.

@spacesailor24
Copy link
Contributor

Thank you for bringing this to our attention! This should be an easy one to fix 🙂

@spacesailor24 spacesailor24 added Bug Addressing a bug Documentation Relates to project wiki or documentation Good First Issue Great to learn the internals of web3.js labels Oct 28, 2020
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug Documentation Relates to project wiki or documentation Good First Issue Great to learn the internals of web3.js Stale Has not received enough activity
Projects
None yet
Development

No branches or pull requests

3 participants