How to get numbers to always display as two digits
coronasdk, lua
Solution
This is completely possible to do without an `if` statement, it's just string formatting...
local secondTime = 0
local minuteTime = 10
print(string.format("%02d:%02d",minuteTime,secondTime))
Problem
I need to display a countdown that turns from 00:10 to 00:09 and not 00:9. How do I make sure that a given number displays with two digits without resorting to cumbersome if-statements?