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

group_digitsdoes not work with negative integers #3891

Closed
lriesterer opened this issue Mar 13, 2024 · 2 comments
Closed

group_digitsdoes not work with negative integers #3891

lriesterer opened this issue Mar 13, 2024 · 2 comments

Comments

@lriesterer
Copy link

group_digits does not work with negative integers.

I would expect fmt::group_digits(-12345) to produce -12,345 and not 18,446,744,073,709,539,271

Here is the code to reproduce: https://godbolt.org/z/vjzrM48bb

@kkarbowiak
Copy link

Seems to be due to a static cast to an unsigned type:

static_cast<detail::uint64_or_128_t<T>>(t.value),

@vitaut
Copy link
Contributor

vitaut commented Mar 19, 2024

Fixed by #3901.

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

No branches or pull requests

3 participants