keep-in-range
v1.0.0
Published
Check if a given number is inside the range of two numbers, the result is limited by the ranges
Downloads
5
Maintainers
Readme
Keep In Range
Check if a given number is inside the range of two numbers, the result is limited by the ranges.
Installation:
npm install keep-in-range --save
API:
keepinrange(value, minValue, maxValue)
Usage:
const keepinrange = require('keep-in-range');
var value = keepinrange(50,100,200); //Value will be 100
var value = keepinrange(150,100,200); //Value will be 150
var value = keepinrange(300,100,200); //Value will be 200