Skip to content

Commit 6f1a132

Browse files
committed
Update to use .format for strings
1 parent ddb47d1 commit 6f1a132

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CircuitPython_OLED_Watch/CircuitPython_OLED_Watch.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
if current.tm_hour / 12 >= 1:
4444
am_pm = "PM"
4545

46-
time_display = "%d:%02d:%02d %s" % (hour, current.tm_min, current.tm_sec, am_pm)
47-
date_display = "%d/%d/%d" % (current.tm_mon, current.tm_mday, current.tm_year)
46+
time_display = "{:d}:{:02d}:{:02d} {}".format(hour, current.tm_min, current.tm_sec, am_pm)
47+
date_display = "{:d}/{:d}/{:d}".format(current.tm_mon, current.tm_mday, current.tm_year)
4848
text_display = "CircuitPython Time"
4949

5050
clock = label.Label(font, text=time_display)

0 commit comments

Comments
 (0)