How to use web3.toWei
This article mainly explains "how to use web3.toWei". Friends who are interested might as well take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to use web3.toWei.
Converts a given fund to a value in wei.
Call:
Web3.toWei (number, unit)
Parameters:
Number:Number | String | BigNumber-numeric or BigNumber
Unit: String-string unit
The optional units are as follows:
Kwei/ada
Mwei/babbage
Gwei/shannon
Szabo
Finney
Ether
Kether/grand/einstein
Mether
Gether
Tether
Return value:
String | BigNumber-A string in the form of a string or BigNumber, depending on the parameters passed in.
Example:
Var value = web3.toWei ('1customers,' ether'); console.log (value); / / "10000000000000000000000". I believe you have a better understanding of "how to use web3.toWei". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!