float to interger?

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
Iximon
Posts: 5
Joined: Thu Sep 08, 2005 6:16 am

float to interger?

Post by Iximon »

Hi

I need to convert an float number to an interger
example:
iNumber = 10
fNumber = 2.35

iNumber2 = iNumber/fNumber --the result of this has to be an interger
-- but the value i get when i divide 10 with 2.35 is 4.25531....
-- i just want to have the value 4, and not 4.25531....

please help
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

Code: Select all

math.floor( iNumber2 )
please use google next time
shows up things like this
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Iximon
Posts: 5
Joined: Thu Sep 08, 2005 6:16 am

Post by Iximon »

hehe, thx for the help.
Post Reply