LabiVila Posted September 1, 2015 Posted September 1, 2015 So hey, what I need is something to return decimal numbers, so if I have a number like: 1.34123, I need a function to return two strings, first one the number before decimals (1) and second string (34123 - the decimal numbers). I'm not expecting the full function, I just need a hand as I have no clue what to use Thanks in advance
Moderators IIYAMA Posted September 1, 2015 Moderators Posted September 1, 2015 Try this:(not tested) local myNumber = 23553.3546 local myText = tostring(myNumber) local myTable = split(myText,".") local myNumber,myDecimal = myTable[1],myTable[2] outputChatBox(myNumber) outputChatBox(myDecimal) 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