This is the ThingsDB documentation for version v0, click here for the latest version!

is_int

This function determines whether the provided value is an integer or not.

This function does not generate an event.

Function

is_int(value)

Arguments

Argument Type Description
value any (required) The value to be tested.

Return value

Returns true if the given value is an integer, else it returns false.

Example

This code shows some return values for is_int():

[
    is_int( 42 ),
    is_int( 0x2a ),
    is_int( 42.0 ),
    is_int( '42' ),
    is_int( true ),
];

Return value in JSON format

[
    true,
    true,
    false,
    false,
    false
]