---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/util.math.restrict.md
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/util.math.restrict.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/jsapi-v2-1/doc/en/llms.txt

# util.math.restrict

Static function.

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

**Returns** value can be limited.

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

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`value`](#param-value)[*](*star) | — | Type: Number

Value can be limited. ||
|| [`min`](#param-min)[*](*star) | — | Type: Number

Minimum limit. ||
|| [`max`](#param-max)[*](*star) | — | Type: Number

Maximum limit. ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
// The code below returns "-180".
ymaps.util.math.restrict(-250, -180, 180);
```

[*star]: Mandatory parameter/option.