AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   IS Integer? (https://forums.alliedmods.net/showthread.php?t=61749)

mysticssjgoku4 10-08-2007 14:48

IS Integer?
 
Hmm, been looking around and can't seem to find anything about this here.

Does anyone know of a way to find out if a float is an integer or not?

example:
15.1 - not an integer
15.0 - is an integer

Thanks

_Master_ 10-08-2007 14:50

Re: IS Integer?
 
if( var == floatround( var ) )

alien 10-09-2007 19:44

Re: IS Integer?
 
if (floatfract(var) == 0.0) { /* is integer */ }


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

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