Moderators IIYAMA Posted June 24, 2014 Moderators Posted June 24, 2014 local theString = tostring(2) if string.len(theString) == 1 then theString = 0 .. theString end print(theString) Does anybody knows how to do this shorter? So if there is one character, it will have a zero at front. So: 01 02 03 04 05 06 07 08 09 10-- 2 characters. 11 12 etc.
Moderators IIYAMA Posted June 24, 2014 Author Moderators Posted June 24, 2014 Thank you very much, I am not very good with string formats.
cheez3d Posted June 24, 2014 Posted June 24, 2014 You can find out more about them here: http://www.cplusplus.com/reference/cstdio/printf/
Moderators IIYAMA Posted June 24, 2014 Author Moderators Posted June 24, 2014 ah, thank you very much again.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now