Mathematical functions

This page describes the additional set of predefined Jsonnet functions for the Data Transformer Script task available in Application Integration.

Before you begin

To use the following predefined functions, you must import the functions library in your script. Importing the functions library lets you use both the standard Jsonnet functions and the predefined Data Transformer functions.

Application Integration supports Jsonnet functions library v0.20.0. For information about the Jsonnet standard functions, see Jsonnet Standard Library.

Is Decimal

Syntax
        
isDecimal(num)
      
DescriptionChecks if the given number is a decimal.
Input parameternum: The input number.
Return typeBOOLEAN
OutputReturns TRUE if the number is a decimal and FALSE otherwise.

Is Even

Syntax
        
isEven(num)
      
DescriptionChecks if the given number is even.
Input parameternum: The input number.
Return typeBOOLEAN
OutputReturns TRUE if the number is even and FALSE otherwise.

Is Integer

Syntax
        
isInteger(num)
      
DescriptionChecks if the given number is an integer.
Input parameternum: The input number.
Return typeBOOLEAN
OutputReturns TRUE if the number is an integer and FALSE otherwise.

Is Odd

Syntax
        
isOdd(num)
      
DescriptionChecks if the given number is odd.
Input parameternum: The input number.
Return typeBOOLEAN
OutputReturns TRUE if the number is odd and FALSE otherwise.

Random Number

Syntax
        
randomNumber(lowerBound, upperBound)
      
DescriptionGenerates a random real number between a specified range.
Input parameterlowerBound: Lower range value (inclusive). Default value is 0.

upperBound: Higher range value (exclusive). Default value is 1.

Return typeA real number.
OutputReturns a random real number between lowerBound and upperBound.

Round

Syntax
        
round(input)
      
DescriptionRounds off a number to the nearest integer.
Input parameterinput: A value to round off.
Return typeINTEGER
Return valueReturns the nearest rounded off integer.

Recommendation