Skip to content

clampToInteger

clampToInteger(value, min, max, roundingMethod?): number

Defined in: packages/core/src/number/integer/clamp-to-integer.ts:15

Clamp a number between a minimum and a maximum value and return an integer in range.

Min is rounding up and max is rounded down prior to clamping.

number

The number to clamp

number

The minimum value

number

The maximum value

RoundingMethod = "round"

number

The clamped integer