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 formatting floating-point values without type and precision provided #4327

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

fsb4000
Copy link
Contributor

@fsb4000 fsb4000 commented Jan 18, 2024

Fixes #4319

libcxx\test\std\utilities\format\format.functions\locale-specific_form.pass.cpp is still failing after this fix.

Format string   {:$<11.6Lg}
Expected output 1,234.57$$$
Actual output   1,234.57$$$$

I guess, it's a different bug, isn't it?

@fsb4000 fsb4000 requested a review from a team as a code owner January 18, 2024 02:01
@frederick-vs-ja
Copy link
Contributor

libcxx\test\std\utilities\format\format.functions\locale-specific_form.pass.cpp is still failing.

Format string   {:$<11.6Lg}
Expected output 1,234.57$$$
Actual output   1,234.57$$$$

I guess, it's a different bug, isn't it?

Looks like #4316.

@StephanTLavavej StephanTLavavej added bug Something isn't working format C++20/23 format labels Jan 18, 2024
@StephanTLavavej StephanTLavavej self-assigned this Jan 18, 2024
@StephanTLavavej
Copy link
Member

Thanks! I looked into using <charconv>'s internal convention of using chars_format{} to signal "plain shortest" with an in-band special value, but the following logic in <format> would require additional adjustments and I felt that it was more risky than your fix.

@StephanTLavavej StephanTLavavej removed their assignment Jan 19, 2024
@StephanTLavavej StephanTLavavej self-assigned this Jan 24, 2024
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit cdf6096 into microsoft:main Jan 25, 2024
35 checks passed
@StephanTLavavej
Copy link
Member

Thanks for fixing this libcxx failure - all shall love shortest round-trip and despair! ❤️ 😹 🛠️

@fsb4000 fsb4000 deleted the fix4319 branch January 25, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working format C++20/23 format
Projects
None yet
Development

Successfully merging this pull request may close these issues.

<format>: incorrect output for some floating-point values
3 participants