Browse Source
This commit fixes the addition of a stray separator before the number when printing an MPZ-backed integer and the first group is three digits long. This fixes #8984. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>pull/15898/head
Alessandro Gatti
1 month ago
committed by
Damien George
2 changed files with 16 additions and 1 deletions
@ -0,0 +1,15 @@ |
|||
# basic functionality test for {} format string using large integers |
|||
|
|||
|
|||
def test(fmt, *args): |
|||
print("{:8s}".format(fmt) + ">" + fmt.format(*args) + "<") |
|||
|
|||
|
|||
# Separator formatter |
|||
|
|||
test("{:,}", 123_456_789_012_345_678_901_234_567) |
|||
test("{:,}", 23_456_789_012_345_678_901_234_567) |
|||
test("{:,}", 3_456_789_012_345_678_901_234_567) |
|||
test("{:,}", -123_456_789_012_345_678_901_234_567) |
|||
test("{:,}", -23_456_789_012_345_678_901_234_567) |
|||
test("{:,}", -3_456_789_012_345_678_901_234_567) |
Loading…
Reference in new issue