Raised This Month: $ Target: $400
 0% 

truncating float to an int


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
MALON
Member
Join Date: Jan 2008
Old 08-19-2008 , 09:26   truncating float to an int
Reply With Quote #1

How do I take a float, such as 125.9925 and make it 125 when the trailing decimal size will be unknown?

When I can't typecast from float to an int like in Java or C++, I normally take 125 - (125.9925%1) but I can't do that in pawn because I can't use the modulo operator on floats.

Thanks!
MALON is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode