stringAsInt()

The system function MathLib.stringAsInt accepts a character value (like "98") and returns the equivalent value of type BIGINT. If the input is nonnumeric, the function returns a NULL.

  MathLib.stringAsInt(numberAsText STRING in)
  returns (result BIGINT nullable)
result
A field that can accept a value of type BIGINT. The receiving field must be nullable.

For details on the implications of assigning numeric values to fields of different types, see Assignments.

numberAsText
A character field or literal string, which can include an initial sign character.

Example

  myField = "-5";

  // result = -5
  result = MathLib.stringAsInt(myField);  

Related reference
EGL library MathLib

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.