cast() Function

Converts a value from its existing type to the specified type.

See Casting: This topic provides additional information on the casting of data types.

Syntax

cast( typeNumber, value )

typeNumber: (Integer) The type number to which the value should be cast.

value: (Any Type) The value that should be cast to typeNumber.

Returns

Any Type

Notes

To retrieve the type number, use typeof(x), where x is a value of the intended type, or reference a type with type!{namespace}type-name (within single quotes).

When referencing a data type, consider the impact that deleting the data type has on the expression that references it.

Examples

cast('type!{http://www.appian.com/ae/types/2009}Integer', 123.4) returns 123

cast(1, 123.4) returns 123

See Also

typeof(): Use the typeof(x) function to retrieve the ID of a data type for the typeNumber parameter.

Delete Data Types: This topic provides additional information on the impact of deleting data types.

Open in Github Built: Tue, May 17, 2022 (03:05:45 PM)

On This Page

FEEDBACK