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

Fix float formatting for 0.0 when precision is 0 #9642

Merged
merged 2 commits into from Aug 30, 2021

Conversation

BanchouBoo
Copy link
Contributor

With precision 0 ({d:.0}), floats will format 0.0 as 0.0 instead of 0, but any other number will completely cut off the decimal point, this corrects 0.0 to also cut off the decimal point.

Copy link
Contributor

@nektro nektro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to mention this on discord, but can you also add to a test block and assert using {d:.0} with 0 results in 0 ?

@BanchouBoo
Copy link
Contributor Author

Done

@andrewrk andrewrk merged commit ef39725 into ziglang:master Aug 30, 2021
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 this pull request may close these issues.

None yet

3 participants