limit-number
v3.0.0
Published
Limit a number between a min and max value
Downloads
123
Maintainers
Readme
limit-number
Limit a number between a min and max value.
Install
npm install limit-number
Usage
const limit = require('limit-number')
limit(0, 10, 5) // 5
limit(0, 10, 15) // 10
limit(0, 10, -5) // 0
Parameters
min
{Number}
Min number.max
{Number}
Max number.num
{Number}
Number.
Returns
{Number}
Limited number.