I'd wanted to give a better answer, but you didn't mention WHICH BigInteger library you were using.
// Yes, use the two '..'
var a = new BigInteger(5..toString());
// Of if you have a variable
var v = 10;
var a = new BigInteger(v.toString());
now, with this knowledge you can override BigInteger
(function() {
var oldConstructor = BigInteger;
BigInteger = function(v) {
if (typeof v === "number") {
return oldConstructor(""+v);
}
return oldConstructor(v);
};
}());