Skip to content

Commit 1b40859

Browse files
authored
Merge pull request #806 from kattni/oled-string-format-update
Update to use .format for strings
2 parents ddb47d1 + 6f1a132 commit 1b40859

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

CircuitPython_OLED_Watch/CircuitPython_OLED_Watch.py

Lines changed: 2 additions & 2 deletions
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)