I have a section of my code where I need to turn user input on a keyboard into a number. I know in other languages you can use built in functions, and I was wondering if Lua/Codea had any such function.
You can just do arithmetic on a string and Lua will attemp the conversion. E.g
x = 7 + "100"
-- x is 107
Or you can use tonumber("100")
to convert a string to a number.
Thank you! this is so much easier than trying to make my own function to convert strings to numbers.