Search code examples
formattingnumbersdecimal-point

How to "human format" Ethereum values in Excel?


When extracting data about an Ethereum wallet via the Etherscan.io API, after converting from JSON to CSV I end up with values like this:

562450260000000000
30174270000000000000
552758590000000000
988800000000000000

The first is 0.56245026 ETH, with a ton of trailing zeroes. The second however is 30.17427 ETH. That's the real trouble here. I can't figure out how to format this column of data so that Excel effectively starts from the right, skips the 10 trailing zeroes, then goes 8 more places, to put the decimal.

Ideally what I want to end up with is this:

0.56245026
30.17427000
0.55275859
0.98880000

The trailing truncation is easy, but placing the decimal properly (preferably without a messy formula that uses position and string manipulation for example to do it) is what I'm stuck on. Anyone know how to do that?


Solution

  • The huge numbers are the numbers you are looking but multiplied by 10e18. You should just divide those huge numbers by 10e18 and you will get your desired numbers.