Function isPositiveInt

  • Description

    判断给定的 $numStr 是否符合非负整数数字格式

    isPositiveInt(null) // 返回 false  
    isPositiveInt("null") // 返回 false
    isPositiveInt(undefined) // 返回 false
    isPositiveInt("undefined") // 返回 false
    isPositiveInt(NaN) // 返回 false
    isPositiveInt("NaN") // 返回 false
    isPositiveInt(Infinity) // 返回 false
    isPositiveInt("Infinity") // 返回 false
    isPositiveInt(0) // 返回 true
    isPositiveInt(+0) // 返回 true
    isPositiveInt(-0) // 返回 true
    isPositiveInt("0") // 返回 true
    isPositiveInt("+0") // 返回 true
    isPositiveInt("-0") // 返回 false
    isPositiveInt(103) // 返回 true
    isPositiveInt(103.00) // 返回 true
    isPositiveInt("103.00") // 返回 false
    isPositiveInt(-103) // 返回 false
    isPositiveInt(+103) // 返回 true
    isPositiveInt("+103") // 返回 true
    isPositiveInt("-103") // 返回 false
    isPositiveInt(+1e3) // 返回 true
    isPositiveInt(-1e3) // 返回 false
    isPositiveInt("1e3") // 返回 false
    isPositiveInt(0.001) // 返回 false
    isPositiveInt(-0.001) // 返回 false
    isPositiveInt(+0.001) // 返回 false
    isPositiveInt("0.001") // 返回 false
    isPositiveInt("-0.001") // 返回 false
    isPositiveInt("+0.001") // 返回 false
    isPositiveInt("+.001") // 返回 false
    isPositiveInt(".001") // 返回 false
    isPositiveInt("1e-3") // 返回 false
    isPositiveInt("1e") // 返回 false
    isPositiveInt("1px") // 返回 false

    Returns

    Parameters

    • numStr: any

    Returns boolean

Generated using TypeDoc