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

Wrong formatting when both alignment and '0' for leading zeroes is given #3236

Closed
stefanhaller opened this issue Dec 21, 2022 · 0 comments · Fixed by #3248
Closed

Wrong formatting when both alignment and '0' for leading zeroes is given #3236

stefanhaller opened this issue Dec 21, 2022 · 0 comments · Fixed by #3248

Comments

@stefanhaller
Copy link

According to https://en.cppreference.com/w/cpp/utility/format/formatter: "If the 0 character and an align option both appear, the 0 character is ignored."

fmt::print("{:<06}\n", -42); // expected: "-42   ", actual: "-42000"
fmt::print("{:>06}\n", -42); // expected: "   -42", actual: "000-42"
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.

1 participant