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

Hex float default alignment #2308

Closed
vasama opened this issue May 23, 2021 · 0 comments · Fixed by #2317
Closed

Hex float default alignment #2308

vasama opened this issue May 23, 2021 · 0 comments · Fixed by #2317

Comments

@vasama
Copy link

vasama commented May 23, 2021

From the documentation (emphasis mine):

Option Meaning
'<' Forces the field to be left-aligned within the available space (this is the default for most objects).
'>' Forces the field to be right-aligned within the available space (this is the default for numbers).
'^' Forces the field to be centered within the available space.
fmt::print("'{:16f}'\n", 4.2f); // output: '        4.200000'
fmt::print("'{:16a}'\n", 4.2f); // output: '0x1.0cccccp+2   '

https://godbolt.org/z/Mf4nzdncs

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

Successfully merging a pull request may close this issue.

2 participants