I am using the following code to get transactions in ether.js
var init = function () {
var wss = new ethers.providers.WebSocketProvider(url);
wss.getTransaction(tx).then(function (transaction) {
wss.on("pending", (tx) => {
console.log(transaction.gasLimit);
}
});
});
which returns the transaction, but the data is formatted as
BigNumber { _hex: '0x0245e5', _isBigNumber: true },
How can I get the decimal value, from the hex?
Thanks