SA-MP Forums Archive
Dropping the remainder of a number - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dropping the remainder of a number (/showthread.php?tid=119821)



Dropping the remainder of a number - Deji - 09.01.2010

I'm new to PAWN, but have been scripting in various other languages for a while and have a simple question...

How do I drop the remainder of a number (turn a float into an integer)?

So..

10.5 = 10
9.2 = 9
29.9 = 29


Re: Dropping the remainder of a number - Babul - 09.01.2010

search "floatround" at the end here:
https://sampwiki.blast.hk/wiki/Scripting...s_Old#floatabs



Re: Dropping the remainder of a number - Striker_Moe - 09.01.2010

Or floatval(), a custom function. Search function will be useful.


Re: Dropping the remainder of a number - Deji - 09.01.2010

Quote:
Originally Posted by Mo3
Or floatval(), a custom function. Search function will be useful.
Can't seem to find it. Any chance of a link?


Re: Dropping the remainder of a number - Correlli - 09.01.2010

Just use floatround, it's perfect for your needs.