Documentation
Reference
2.1.55 (current version)
collection
interactivityModel
Interfaces

util.math.restrict

Static function.

Restricts an input numeric value to the set minimum and maximum limits.

Returns value can be limited.

{ Number } util.math.restrict(value, min, max)

Parameters:

ParameterDefault valueDescription
value*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Number

Value can be limited.

min*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Number

Minimum limit.

max*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Number

Maximum limit.

* Mandatory parameter/option.

Example:

ymaps.util.math.restrict(-250, -180, 180) = -180