• Limit a Number

    Parameters

    • input: number
    • max: number

    Returns number

    Example

    import { number } from "@rjweb/utils"

    number.limit(100, 40) // 40
    number.limit(100, 2000) // 100
    number.limit(1042, 1000) // 1000

    Since

    1.5.0

    Supports

    nodejs, browser