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. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Moderators IIYAMA Posted June 24, 2014 Author Moderators Posted June 24, 2014 Thank you very much, I am not very good with string formats. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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