I don't want to load the web3 library, I do however want to convert Either to Wei, does anyone have a JavaScript function to share.
I don't mind loading a smaller library
Just multiply the number of ether by 1e18 (or 10**18). Done and done!
Accourding to this table:
1 Ether is 1^18 = 1000000000000000000 Wei.
1 Wei is 0.000000000000000001 Ether.
In javascript it would be wei = eth_amount*10e17
. Not *10e18
. e
counts as the 10
and *10e18
would multiply your eth by one order of magnitude too many!
ethereum-units
instead