summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/string_format_intbig.py
blob: a36c36752e705ba2816823d59a1831bdf31c265d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)