lv_micropython/tests/basics/string_format_intbig.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
478 B
Python
Raw Normal View History

# 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)