Clamp a number
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.jshintrc
.travis.yml
index.js
license
package.json
readme.md
test.js

readme.md

math-clamp Build Status

Clamp a number

Install

$ npm install --save math-clamp

Usage

var mathClamp = require('math-clamp');

mathClamp(1, 2, 4);
//=> 2

API

mathClamp(number, min, max)

Related

License

MIT © Sindre Sorhus