What I am wondering is if there is a way to check a specific place value?
For example, if a number is 52.8, is there a way that I can see what the value of the decimal place?
What I am wondering is if there is a way to check a specific place value?
For example, if a number is 52.8, is there a way that I can see what the value of the decimal place?
Yes you can! You can use string.sub(), try using this:
local number = 52.8
local decimal = string.sub(number, 4) -- 4 is the 4th value in the number. so in this case, its 8
print(decimal) --> 8
If this help, then please accept this answer!
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Thank you! This is very helpful to know!
No problem.