num.js

Methods

(static) clamp(number, min, max) → {number}

Keep a number between a min and a max value

Parameters:
NameTypeDescription
numbernumber

The number to clamp

minnumber

The minimum value

maxnumber

The maximum value

Returns:

the clamped number

Type: 
number