Novice, Paragon, Master

    limit-number
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/limit-number package

    3.0.0 • Public • Published

    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.

    Install

    npm i limit-number

    DownloadsWeekly Downloads

    45

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    9.65 kB

    Total Files

    6

    Last publish

    Collaborators

    • electerious