Tasmota/lib/libesp32/Berry/examples/strmod.be

8 lines
255 B
Plaintext
Raw Normal View History

2021-04-12 18:53:35 +01:00
import string
print(string.format('%.3d', 12))
print(string.format('%.3f', 12))
print(string.format('%20.7f', 14.5))
print(string.format('-- %-40s ---', 'this is a string format test'))
print(string.format('-- %40s ---', 'this is a string format test'))