You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just checked and you are right, there is a difference between web3.js and using https://eth-converter.com/ in the first function toWei(), i'll ping the team to investigate this asap!
// import web3 moduleimport{Web3}from"web3";constweb3=newWeb3("https://rpc2.sepolia.org");constfirstConversion=web3.utils.toWei("0.0033086855466118933","ether");//ether to weiconsole.log(firstConversion);//33086855466118933 => web3.js//3308685546611893 => eth-converter
Expected behavior
the result should be same as input 0.0033086855466118933
Actual behavior
this result is 0.033086855466118933
Steps to reproduce the behavior
Logs
const web3 = require("web3"); const inst = new web3.Web3(); console.log(inst.utils.fromWei(inst.utils.toWei("0.0033086855466118933", "ether"), "ether"));
the log output is 0.033086855466118933
expected output 0.0033086855466118933
Environment
npm 10.2.4
node 20.11.1
os Win 11
The text was updated successfully, but these errors were encountered: