Skip to main content
Integers are positive and negative whole 32-bit unsigned numbers without decimals. If you need to work with decimals, use the Float data type.

Constructors

Integer()

Default constructor.

Integer(Integer)

Pass a value to copy into a new object.

Integer(String)

Pass a String containing a number. The constructor will parse the text and create an Integer object.

Methods

toString()

Converts a numeric value to its string representation. One of the most frequently used methods, typically when you are going to output something.
Returns: CRMScript.Global.String Example:

toBool()

Converts a numeric value to its boolean representation. Returns false if the integer is zero, otherwise true.
Returns: CRMScript.Global.Bool Example:

abs()

Converts a numeric value to its absolute value (the non-negative value of the number without regarding the sign). One of the most frequently used methods, typically when you are going to output something.
Returns: CRMScript.Global.Integer Example:

toHex()

Converts an Integer to a hexadecimal string.
Returns: CRMScript.Global.String
By default, it converts the value of the current object. You can optionally pass a specific value to convert. (See below)
Example:

toHex(Integer)

Converts an Integer to a hexadecimal string. Same as above except you write toHex(i) rather than i.toHex().
Returns: CRMScript.Global.String

isNull()

Returns true if it has no value and false if it does.
Returns: CRMScript.Global.Bool
A NULL/NUL/NIL Integer is different from zero, in that it is conceptually without a value. However, when a null Integer is used naively, CRMScript is usually forgiving and interprets it as zero.
Example: