4

Let's take the following company. The current ETH Balance is 268,691.327038426 Ether:

enter image description here

But API response 268698327038426745609145:

enter image description here

As you can see API response does't contain floating point so the balance value is very big.

Is it bug?

1 Answer 1

3

it isn't a bug the balance is returned in weis not in The Ethers.

chek one of many conversion tools: https://etherconverter.online/

268705.32703842675 Ether = 268705327038426745609145 wei

the "," is used to separate three digits (look at the amount in $).

5
  • Thanks for the response. Could please help how can I convert wei -> Eth by using API? The thing is I need to display balance in my site and I can't do convertion by hand. Commented Oct 30, 2016 at 20:45
  • divide by 10^18 or just count 18 digit from right then take the rest as balance in Ether Commented Oct 30, 2016 at 20:51
  • ethereum.stackexchange.com/questions/4194/… Commented Oct 30, 2016 at 21:01
  • Could you point me where the documentation describes that all values returned in wei units? Commented Oct 31, 2016 at 7:13
  • re: documentation JSON RPC API eth_getBalance and web3 JavaScript API web3.eth.getBalance Commented Oct 31, 2016 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.