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

fromWei Returns "0." for 0 and Any Denomination Other Than Wei #7339

Open
danforbes opened this issue Oct 17, 2024 · 4 comments · May be fixed by #7366
Open

fromWei Returns "0." for 0 and Any Denomination Other Than Wei #7339

danforbes opened this issue Oct 17, 2024 · 4 comments · May be fixed by #7366
Labels
4.x 4.0 related Bug Addressing a bug Good First Issue Great to learn the internals of web3.js P1 High severity bugs

Comments

@danforbes
Copy link
Contributor

When fromWei is called with 0 and any denomination other than wei, it returns the value "0." The trailing decimal point is unnecessary and should not be included.

@whitemoshui
Copy link

Hi, may I work on researching and fixing this issue? It looks like a good-first-issue. Also, I'd like to ask if this kind of change would be considered a breaking change?

@mconnelly8 mconnelly8 added Bug Addressing a bug 4.x 4.0 related P1 High severity bugs labels Oct 29, 2024
@TemirlanBasitov
Copy link
Contributor

@danforbes we can add check. if the result is "0." and, if so, return "0" instead.

@danforbes danforbes linked a pull request Nov 4, 2024 that will close this issue
17 tasks
@mconnelly8
Copy link

Hey @whitemoshui, go ahead and take a stab at this. This wouldn't be considered a breaking change.

We'd like to get this implemented soon, so let us know if you have any questions.

@mconnelly8 mconnelly8 added the Good First Issue Great to learn the internals of web3.js label Nov 4, 2024
@whitemoshui
Copy link

Hey @whitemoshui, go ahead and take a stab at this. This wouldn't be considered a breaking change.

We'd like to get this implemented soon, so let us know if you have any questions.

I saw there is a PR to fix. If he doesn't response, I can take over this issue later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related Bug Addressing a bug Good First Issue Great to learn the internals of web3.js P1 High severity bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@danforbes @TemirlanBasitov @mconnelly8 @whitemoshui and others