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

Standard form of float always includes the ".0" #1943

Closed
madscientist opened this issue Oct 19, 2020 · 4 comments
Closed

Standard form of float always includes the ".0" #1943

madscientist opened this issue Oct 19, 2020 · 4 comments

Comments

@madscientist
Copy link

madscientist commented Oct 19, 2020

I'm using fmt 7.0.3 (on GNU/Linux with GCC 10.2).

When I format a simple fmt::format("double {}", (double)90) the result is double 90.0. Based on my reading of the spec (and what used to be generated by fmt 5.3.0, which I was using previously) this is incorrect and the output should be just double 90 (no decimal), because I didn't include the # to select the alternative form.

Am I misunderstanding something?

@OnurKader
Copy link

I'm not sure about which commit fixed it but it works as expected in trunk

Godbolt Link

@vitaut vitaut closed this as completed Oct 20, 2020
@vitaut
Copy link
Contributor

vitaut commented Oct 20, 2020

Same as #1893.

@madscientist
Copy link
Author

Oh thanks! I did search the issue tracker for this but that issue is described differently enough that I guess my search terms didn't match it... :( I should have tried master HEAD first.

@vitaut
Copy link
Contributor

vitaut commented Oct 20, 2020

No worries.

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

No branches or pull requests

3 participants