Geth version: geth version
OS & Version: ubuntu 16.04
ether amount
TypeError: web3.fromWei is not a function
1- install web3: npm i web3
2- let Web3 = require('web3')
3- let web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'))
4- let ether = parseInt(web3.fromWei(eth.getBalance(eth.accounts[0]), 'ether'))
Please open a bug report on the web3 repo. https://github.com/ethereum/web3.js/
@Zied-Guesmi its changed as below.
http://web3js.readthedocs.io/en/1.0/web3-utils.html#fromwei
web3.utils.fromWei(eth.getBalance(eth.accounts[0]), 'ether');
@maulikvora thanks a lot !!
@maulikvora Thanks for the updated documentation, it looks like the github repo docs are out of date : https://github.com/ethereum/wiki/wiki/JavaScript-API#web3fromwei
Most helpful comment
@Zied-Guesmi its changed as below.
http://web3js.readthedocs.io/en/1.0/web3-utils.html#fromwei
web3.utils.fromWei(eth.getBalance(eth.accounts[0]), 'ether');