Home / Search/ Language Reference/ Functions/ Scalar Functions/ Conversion Functions/gettype

gettype

The gettype function returns the type of the input value.

Syntax

gettype( Expression )

Arguments

  • Expression: The value whose type you want to check.

Returns

Depending on the input, returns one of the following strings:

InputReturned stringInput examples
A booleanbooltrue, false, 3 < 5
A numberint for values in range -2^31…2^31-1.3, 1000
long for values in range -2^63…2^63-1 but greater than int.2 ** 40
decimal for values greater than long.2 ** 65
real3.15, 3 / 5
NaNNaN
A bigintSame as a number: int, long, or decimal, based on the value range.BigInt(1234567890123456789)
A stringstring'Aloa'
[]array[17, 3]
{}dictionary{ foo: 'bar' }
nullnullnull
UndefinednullUndefined field reference
Anything else, like functionsunknowncoalesce(33)

Examples

InputOutput
truebool
falsebool
0int
42int
2 ** 40long
BigInt(2 ** 60)long
3.1415real
2 ** 65decimal
BigInt(2 ** 65)decimal
[17, 3]array
{ foo: "bar" }dictionary
Number.NaNNaN
nullnull
Undefinednull
() => 42unknown