Clamp a value between two other values
Want to see pretty graphs? Log in now!
npm install clamp
|2||downloads in the last week|
|7||downloads in the last month|
|Last Published By|
|Version||1.0.0 last updated a month ago|
|Keywords||clamp, math, greater, less, than, between|
Clamp a value between two other values. It's as simple as modules come - saving keystrokes because I've had to write this function too many times.
clamp(value, a, b)
value, if it is between
b. Otherwise, returns the number
it's gone past.
MIT. See LICENSE.md for details.