Skip to content

Limit a number between a min and max value.

License

Notifications You must be signed in to change notification settings

electerious/limit-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

limit-number

Build Coverage Status

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.

About

Limit a number between a min and max value.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published