Even though Lua does not differentiate between floating point numbers and integers, there are some cases when you want to use integers. What is the best way to covert a number t
You could use math.floor(x)
math.floor(x)
From the Lua Reference Manual:
Returns the largest integer smaller than or equal to x.