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:
Parameter |
Default value |
Description |
— |
Type: Number Value can be limited. |
|
|
— |
Type: Number Minimum limit. |
|
— |
Type: Number Maximum limit. |
* Mandatory parameter/option.
Example:
// The code below returns "-180".
ymaps.util.math.restrict(-250, -180, 180);
Mandatory parameter/option.