0

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"

1
Contributor
1
Reply
9
Views
3 Years
Discussion Span
Last Post by jean_5
0
isBigInt: function () {
        var val = bigInt();
        if (bigInt(val.toString()).greaterOrEquals("-9223372036854775808") && bigInt(val.toString()).lesserOrEquals("9223372036854775807"))
            return true;
        else
            return false;
    }
    ,

Edited by jean_5

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.