Integer

Description

Converts the value of a string to an integer.

Syntax

Integer ( string )

Argument

Description

string

The string you want returned as an integer

Returns

Integer. Returns the contents of string as an integer if it succeeds and 0 if string is not a number.

Examples

Example 1

This expression converts the string 24 to an integer:

Integer("24")

Example 2

This expression for a computed field returns “Not a valid age” if age does not contain a number. The expression checks whether the Integer function returns 0, which means it failed to convert the value:

If (Integer(age) <> 0, age, "Not a valid age")

Example 3

This expression returns 0:

Integer("3ABC")    // 3ABC is not a number

Example 4

This validation rule checks that the value in the column the user entered is less than 100:

Integer(GetText()) < 100

Example 5

This validation rule for the column named age insures that age contains a string:

Integer(age) <> 0

See also