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

print(123.00) outputs "123.000" (extra 0 at the end) #25

Closed
JPTa opened this issue Nov 24, 2023 · 3 comments · Fixed by #26
Closed

print(123.00) outputs "123.000" (extra 0 at the end) #25

JPTa opened this issue Nov 24, 2023 · 3 comments · Fixed by #26

Comments

@JPTa
Copy link

JPTa commented Nov 24, 2023

int num = fractional / pow(10, d);

When 'fractional' is zero it is not necessary to print it out at the end:

return (out_of_bounds || print(fractional));

@platisd
Copy link
Owner

platisd commented Nov 24, 2023

If I understood right, the proposed pull request (#26) will fix your issue. Do you agree?

@JPTa
Copy link
Author

JPTa commented Nov 24, 2023

Yeah, that fixes it.

@platisd
Copy link
Owner

platisd commented Nov 24, 2023

Thank you for reporting the issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants