- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
if number >= 0 and number <= 9 then
string.format('00%d', number)
end
if number >= 10 and number <= 99 then
string.format('0%d', number)
end
if number >= 100 and number <= 999 then
string.format('%d', number)
end
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
if number >= 0 and number <= 9 then
string.format('00%d', number)
end
if number >= 10 and number <= 99 then
string.format('0%d', number)
end
if number >= 100 and number <= 999 then
string.format('%d', number)
end
MAKAKA # 0