Skip to content
Clamp a number
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.npmrc
.travis.yml
index.js
license
package.json
readme.md
test.js

readme.md

math-clamp Build Status

Clamp a number

Install

$ npm install math-clamp

Usage

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

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

API

mathClamp(number, min, max)

Related

You can’t perform that action at this time.