Created
August 13, 2017 17:43
-
-
Save josephros/d916b72e3908373f521c55c1cb5a1c42 to your computer and use it in GitHub Desktop.
Update the interface with the results
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var percentOwned = balance.div(totalSupply).mul(100); | |
var divisor = new web3.BigNumber(10).toPower(decimals); | |
totalSupply = totalSupply.div(divisor); | |
balance = balance.div(divisor); | |
var results = '<b>Token:</b> ' + name + '<br />'; | |
results += '<b>Total supply:</b> ' + totalSupply.round(5) + '<br /><br />'; | |
results += accountAddress + ' owns ' + balance.round(5) + ' which is ' + percentOwned.round(5) + '% of the total supply'; | |
$('#results').html(results); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment