decimals()

The mathLib.decimals() system function returns the number of decimal places with which a numeric variable was defined.

Syntax

  mathLib.decimals(numericVariable DECIMAL in)
  returns (result INT)
numericVariable
Input can be any variable that is assignment compatible with DECIMAL.
result
The defined number of decimal places for numericVariable is returned as an INT. If numericVariable is an integer, the result is 0. Floating point variables, which are not defined with a fixed number of decimal places, also cause the function to return 0.

Example

  myVar BIN(9,4);

  result = mathLib.decimals(myVar);  // result = 4

Feedback