Lua and Integers!

Posted by Gore on Tue 13 Feb 2007 07:31 PM — 3 posts, 19,103 views.

#0
Once again, an extremely apparent novice Lua question:

I can't seem to find how to convert a floating point number to an integer.

if x = 7.34934 I want to convert x to 7

Also if x = 7.9348, I still want to convert it to 7.

Any ideas on how I can do this, did I miss the function somewhere?
USA #1
Use the function math.floor. (math.floor rounds down, and math.ceiling rounds up.)
#2
Ahhh thanks a bunch! Sorry I overlooked that :/