window.range

Supported in:
window.range(numeric_values, optional should_ignore_zero_values)

Description

Returns the range of the values input values found (min, max inclusive). Each value can be an integer or a floating point. Setting the optional second argument to true ignores zero values.

Param data types

INT|FLOAT, BOOL

Return type

ARRAY_FLOATS

Code samples

The following code samples illustrate some of the ways you might use the window.range function.

Example: minimum and maximum integer

This example shows the minimum and maximum integer value.

window.range([1, 2, 3, 4], false) = [1.000000, 4.000000]
Example: minimum and maximum floating point

This example shows the minimum and maximum floating point value.

window.range([1.100000, 39.400000, 2.400000], false) = [1.100000, 39.400000]
Example: minimum and maximum negative integer

This example shows the minimum and maximum negative integer value.

window.range([-1.100000, 1.100000, 0.000000, 2.400000], false) = [-1.100000, 2.400000]
Example: ignored 0 value

This example shows how 0 values are ignored when you set the second parameter.

window.range([0, 0, 0, 394, 1], true) = [1.000000, 394.000000]