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

<format>: Incorrect decimal point placement when using alternate form without a type #3003

Closed
mordante opened this issue Aug 7, 2022 · 1 comment · Fixed by #3815
Closed
Assignees
Labels
bug Something isn't working fixed Something works now, yay! format C++20/23 format

Comments

@mordante
Copy link
Contributor

mordante commented Aug 7, 2022

@fsb4000 reported a bug in libc++'s format implementation. While investigating that bug I noticed that for a small part I'm in good company; MSVC STL has the same bug:

std::format("{:#.{}}\n", 1200.0 0);  // 1e+03. instead of 1.e+03
std::format("{:#.{}g}\n", 1200.0 0); // 1.e+03 as expected (types a, e, and f are good too.)

More examples at https://godbolt.org/z/fTsKaf6vz

@StephanTLavavej StephanTLavavej added bug Something isn't working format C++20/23 format labels Aug 7, 2022
@CaseyCarter
Copy link
Member

CaseyCarter commented Aug 8, 2022

Thanks for the report-back! (Physician, heal thyself! 😄)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Something works now, yay! format C++20/23 format
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants