Skip to main content
A class for representing floating point numbers as objects. Floats are approximations of real numbers written with decimals. If you don’t need to work with decimals, use the Integer data type.

Constructors

Float()

Default constructor.

Float(Float)

Pass a value to copy into a new object.

Float(Integer)

Pass an Integer and have it converted to a Float object.

Float(String)

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

Float(Long)

Create a new Float instance from a Long instance.

Methods

toString(Integer)

Converts a float value to its string representation. One of the most frequently used methods, typically when you are going to output something.
Returns: CRMScript.Global.String
You must always specify how many decimal digits you want.
Example:

abs()

Converts a float value to its absolute value (the non-negative value of the number without regarding the sign).
Returns: CRMScript.Global.Float Example:

floor()

Returns the Integer preceding the decimal separator. The floor of a Float is calculated by rounding downward to the nearest Integer.
Returns: CRMScript.Global.Integer Example:

round()

Returns the Integer approximation of the Float without any decimals. It is calculated by rounding to the nearest Integer.
Returns: CRMScript.Global.Integer Example:

isNull()

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