I have installed the npm install big-integer https://www.npmjs.org/package/big-integer to test if the number is in the specified range with this code:

isBigInt: function () {
var val = $(this).valueOf
var valor = bigInt(val);
var minimo = bigInt("-9223372036854775808");
var maximo = bigInt("9223372036854775807");
if (bigInt(val).greaterOrEquals(minimo) && bigInt(val).lesserOrEquals(maximo))
return true;
else
return false;
}
,
($input.hasClass("bigint") && !$input.isBigInt())

but when I compile the code appears the following message:

"JavaScript runtime error: Invalid integer: NaN"

isBigInt: function () {
        var val = bigInt();
        if (bigInt(val.toString()).greaterOrEquals("-9223372036854775808") && bigInt(val.toString()).lesserOrEquals("9223372036854775807"))
            return true;
        else
            return false;
    }
    ,
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.