Checks if the value of a variable or expression has no fractional component.
IsInt ( variable )
variable | The variable/expression to check. |
Success: | 1 - No fractional component |
Failure: | 0 - Fractional component |
The function will return 1 if the value is a float with no fractional component (e.g. 1.000).
See language datatypes for a detailed description.
IsArray, IsBinary, IsBool, IsFloat, IsHWnd, IsMap, IsNumber, IsPtr, IsString, StringIsInt, VarGetType
#include <MsgBoxConstants.au3>
Example()
Func Example()
Local $bIsInt1 = IsInt(-12345) ; Returns 1
Local $bIsInt2 = IsInt(3.0000) ; Returns 1
Local $bIsInt3 = IsInt(7.5 - 4.5) ; Returns 1 since it evaluates to integer 3
Local $bIsInt4 = IsInt(4.5) ; Returns 0 as the value is a Number but not Integer.
Local $bIsInt5 = IsInt("5432") ; Returns 0 as the value is a string.
MsgBox($MB_SYSTEMMODAL, "", "IsInt: " & @CRLF & _
$bIsInt1 & @CRLF & $bIsInt2 & @CRLF & $bIsInt3 & @CRLF & $bIsInt4& @CRLF & $bIsInt5)
EndFunc ;==>Example