What does %02i string format do?

Hi, I was learning for string formats, but I can’t understand this one: %02i, can you please explain what this does?

1 Like

It truncates the value (the i pattern) in Lua 5.1/Luau then pad the zero so it has at least 2 integer digits.
So 1.75 → 01, 2 → 02 and 11.6 → 11

6 Likes

Oh, makes sense. Thank you very much!