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)
 
Description Checks if the given number is a decimal.
Input parameter num: The input number.
Return type BOOLEAN
Output Returns TRUE if the number is a decimal and FALSE otherwise.

Is Even

Syntax
 
isEven(num)
 
Description Checks if the given number is even.
Input parameter num: The input number.
Return type BOOLEAN
Output Returns TRUE if the number is even and FALSE otherwise.

Is Integer

Syntax
 
isInteger(num)
 
Description Checks if the given number is an integer.
Input parameter num: The input number.
Return type BOOLEAN
Output Returns TRUE if the number is an integer and FALSE otherwise.

Is Odd

Syntax
 
isOdd(num)
 
Description Checks if the given number is odd.
Input parameter num: The input number.
Return type BOOLEAN
Output Returns TRUE if the number is odd and FALSE otherwise.

Random Number

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

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

Return type A real number.
Output Returns a random real number between lowerBound and upperBound.

Round

Syntax
 
round(input)
 
Description Rounds off a number to the nearest integer.
Input parameter input: A value to round off.
Return type INTEGER
Return value Returns the nearest rounded off integer.

Recommendation

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月24日 UTC.