lua - How to get numbers to always display as two digits -


i need display countdown turns 00:10 00:09 , not 00:9. how make sure given number displays 2 digits without resorting cumbersome if-statements?

this possible without if statement, it's string formatting...

local secondtime = 0 local minutetime = 10 print(string.format("%02d:%02d",minutetime,secondtime)) 

Comments