Just trying to keep a countdown timer with hours:minutes:seconds in the proper format, and have tried using:
hours = math.floor(timeuntilnext / 3600)
mins = math.floor((timeuntilnext - (hours*3600)) / 60)
secs = math.floor((timeuntilnext - (hours*3600) -(mins*60) ))
displayed with:
countdown.text = hours … “:” … mins … “:” … secs
(where timeuntilnext is the number of seconds)
Works fine, other than things turning to single digits when they’re below 10.
How would I force the display to show a preceeding 0 in this case so seconds would show as :03 instead of :3?
Thanks!