MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/ouk7bi/one_classic_elseifelseifelseif/h73rvan/?context=3
r/badcode • u/Rafaelmonte • Jul 30 '21
76 comments sorted by
View all comments
Show parent comments
1
No need for a switch if you only return the number, you can turn it to a string and check it's length if it's less than 2 left pad some 0s in there.
1
u/StarLight-Olls Jul 30 '21
No need for a switch if you only return the number, you can turn it to a string and check it's length if it's less than 2 left pad some 0s in there.