I am fairly new to this and please let me know if I am wrong in any point.
I am trying to convert WEI into Eth, without using the Web3 library.
const weiValue = 100000;
const ethValue = ethers.utils.formatEther(weiValue);<--- answer is correct at 0.0000000000001
My code requires me to change 40000000000000000 wei to eth.
and here is what I have:
const weiValue = 40000000000000000;
const tokenRateString = tokenRate.toString();
const ethValue = ethers.utils.formatEther();
I believe I need to convert the Wei into a string as it too large to be represented accurately as integers in JS
I am confused on what is the intermediate step here