-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Interpret precision as display width #4443
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Please address inline comments and add a test case to format-test.cc
Added the test case for introduced function dd25ea9. |
test/format-test.cc
Outdated
EXPECT_EQ( | ||
fmt::detail::count_code_points_with_display_width_precision("🐱🐱🐱", 5), | ||
2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's test the output of fmt::format
instead of this internal function to make sure that precision computation works end-to-end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done as part of 93fabd0
Thank you!
…st internal function
Merged, thanks! |
Fixes #4272
It now correctly considers precision as display width precision.
Please let me know, if I need to add any test cases as well.
Thanks!