diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-06 22:12:42 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-06 22:12:42 +0300 |
commit | 8c75bd26e21dc392ecf62dc71a47ac3a151d27c0 (patch) | |
tree | dcd3d480a4099e5d3205a2ed132df534fc61b024 /tests | |
parent | 380f147d2e39904641e280ab19f8f77daf3c5be3 (diff) | |
parent | b69f9fa31f976cac4cdcb441612c8a72b10af457 (diff) | |
download | micropython-8c75bd26e21dc392ecf62dc71a47ac3a151d27c0.tar.gz micropython-8c75bd26e21dc392ecf62dc71a47ac3a151d27c0.zip |
Merge pull request #668 from dhylands/print-prec
Fix str.modulo when precision is specified.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basics/string-format-modulo.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/basics/string-format-modulo.py b/tests/basics/string-format-modulo.py index c8fdc06f68..f3f57b45ad 100644 --- a/tests/basics/string-format-modulo.py +++ b/tests/basics/string-format-modulo.py @@ -51,8 +51,18 @@ print("%#06x" % 18) print("%*d" % (5, 10)) print("%*.*d" % (2, 2, 20)) -# TODO: Formatted incorrectly -#print("%*.*d" % (5, 8, 20)) +print("%*.*d" % (5, 8, 20)) + +print(">%8.4d<" % -12) +print(">% 8.4d<" % -12) +print(">%+8.4d<" % 12) +print(">%+8.4d<" % -12) +print(">%08.4d<" % -12) +print(">%08.4d<" % 12) +print(">%-8.4d<" % -12) +print(">%-08.4d<" % -12) +print(">%-+08.4d<" % -12) +print(">%-+08.4d<" % 12) # Cases when "*" used and there's not enough values total try: |