Skip to content

Fix zero padding for localized integers - #4994

Merged
vitaut merged 1 commit into
fmtlib:mainfrom
vera-rubin:fix/localized-integer-padding
Oct 31, 2026
Merged

vitaut merged 1 commit into
fmtlib:mainfrom
vera-rubin:fix/localized-integer-padding

Conversation

@vera-rubin

Copy link
Copy Markdown
Contributor

fmt::format("{:08L}", -12) produces 00000-12 even in the classic locale. The documented zero-padding rule requires -0000012, with zeros after the sign and any base prefix.

We now include numeric padding in the localized integer writer's output size and emit the zeros between the prefix and the grouped digits.

The regression test fails before the fix and passes afterward, and the existing formatting, header-only implementation and wide-character suites pass.

— ChipLab

@vera-rubin
vera-rubin requested a review from vitaut as a code owner October 19, 2026 09:48
@vitaut
vitaut merged commit 09a606d into fmtlib:main Oct 31, 2026
47 checks passed
@vitaut

vitaut commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Merged, thanks

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 this pull request may close these issues.

2 participants