MathLib.decimals function

MathLib.decimals returns the number of decimal places in the type of a numeric variable.

Package

eglx.lang

Syntax
static function decimals(value decimal in) returns(int);
value
Takes a variable.

The function returns a zero if the variable is of an integer type or the FLOAT type.

Example use

After the following code runs, the value of result is 4:

myVar BIN(9,4);

result = mathLib.decimals(myVar);  
Comments

In the case of Java™, EGL uses methods in the Java StrictMath class that are equivalent to the EGL functions. This usage ensures that the runtime behavior is the same for every Java Virtual Machine.

Compatibility

Table 1. Compatibility
Target Issue
Java No issues.
JavaScript No issues.