forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

float to interger?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
Iximon



Joined: 08 Sep 2005
Posts: 5

PostPosted: Sat Oct 01, 2005 2:32 am    Post subject: float to interger? Reply with quote

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
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Sat Oct 01, 2005 2:42 am    Post subject: Reply with quote

Code:
math.floor( iNumber2 )


please use google next time
shows up things like this
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
Iximon



Joined: 08 Sep 2005
Posts: 5

PostPosted: Sat Oct 01, 2005 5:42 am    Post subject: Reply with quote

hehe, thx for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group