Skip to content

Commit e93c595

Browse files
authored
Merge pull request #3145 from adafruit/TheKitty-patch-12
Clarify leading zero handling in time display
2 parents e575e8f + 156be57 commit e93c595

File tree

1 file changed

+3
-1
lines changed
  • Digital_Clock_with_CircuitPython

1 file changed

+3
-1
lines changed

Digital_Clock_with_CircuitPython/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ def clock_conversion(h, m, set_brightness):
5858
hour_12 = h if h <= 12 else h - 12
5959
if hour_12 == 0:
6060
hour_12 = 12
61-
display.print(f"{(hour_12):02}:{m:02}")
61+
display.print(f"{(hour_12):02}:{m:02}") # Use for leading zero re. 09:35
62+
# display.print(f"{hour_12:2}:{m:02}") # uncomment to suppress leading zero
63+
# # (shows 1:00 instead of 01:00)
6264
display.ampm = am_pm
6365
if set_brightness:
6466
if awake_hours[0] <= h <= awake_hours[1] - 1:

0 commit comments

Comments
 (0)