Skip to main content

LIMIT

Limit a number to be within the provided range; if less than the minimum, return the minimum, or if greater than the maximum return the maximum

Example Usage

LIMIT(1.5, 2, 5) -> 2
LIMIT(2.5, 2, 5) -> 2.5
LIMIT(7, 2, 6) -> 5

Overview

Function signature
LIMIT(value, minimum, maximum)

Category
Math

Return data type
float

Arguments

NameDataTypeList Options                          Description
valuefloatThe value to be limited
minimumfloatThe minimum on the limit range; if value is below this, minimum is returned
maximumfloatThe maximum on the limit range; if value is greater than this, maximum is returned