max() - Number Function | Zoho QEngine Help

max()

In a nutshell
The max() function takes two numbers as arguments and returns the larger of the two as a decimal value. Both parameters accept number or decimal data types. It is useful in test scripts where you need to compare two numeric values and work with the higher result.

Overview

The max() function takes numberOne and numberTwo as arguments, and returns the bigger number of the two.

Return Type

  • Decimal

Syntax

  1. <variable> = <numberOne>.max( <numberTwo> );

(OR)

  1. <variable> = max(<numberOne>, <numberTwo> );

ParameterDescriptionData type
<variable>Variable which will contain the returned value.DECIMAL
<numberOne>The number which has to compared with numberTwoNUMBER or DECIMAL
<numberTwo>The number which has to compared with numberOneNUMBER or DECIMAL

Examples

  1. numOne = 100;
  2. numTwo = 200;
  3. maxValue = numOne.max(numTwo);    // returns 200