Zero padding before numbers in lua

Zero padding in front of numbers in lua

1. Examples

Input: 3
Output: 03

Two, the solution

local number = 3
string.format("%02d",number)

Supongo que te gusta

Origin blog.csdn.net/weixin_56130753/article/details/126282465
Recomendado
Clasificación