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

Add support for grouping numbers and '_', ',' separators #3954

Closed
amal-khailtash opened this issue May 10, 2024 · 1 comment
Closed

Add support for grouping numbers and '_', ',' separators #3954

amal-khailtash opened this issue May 10, 2024 · 1 comment

Comments

@amal-khailtash
Copy link

C++ 14 supports optional digit separators like 1'000'000, 0b1010'1010, or 0xFF'FF'FF

Underscores are also acceptable in literals as described in PEP 498 and PEP-515 using "{number:,}", also for larger numbers a comma separated thousand separator is accepted as in "{number:,}".

It would be great if grouping numbers with separators ("_", "'", ",") are supported. Python groups decimal numbers in 3 digits (thousands), binary, octal and hex numbers are grouped in 4 digits (4 bits, 12 bits, or 32 bits respectively).

NOTE: Python does not allow grouping by a single quote though! "'"

More references here:

@vitaut
Copy link
Contributor

vitaut commented May 11, 2024

Same as #3840.

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

No branches or pull requests

2 participants