Skip to content

Function: castValueAsInteger()

ts
function castValueAsInteger(value: unknown): number;

Casts an unknown value to an integer

Parameters

ParameterTypeDescription
valueunknownThe value to cast

Returns

number

The value as an integer (truncated if necessary)

Throws

E_UNCASTABLE when the value cannot be cast to an integer