Miss any of our Open RFC calls?Watch the recordings here! »

limit-number

2.0.1 • Public • Published

limit-number

Travis Build Status Coverage Status Dependencies Greenkeeper badge

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.

Install

npm i limit-number

DownloadsWeekly Downloads

50

Version

2.0.1

License

MIT

Unpacked Size

9.9 kB

Total Files

6

Last publish

Collaborators

  • avatar