Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GWeiToString ¶ added in v1.1.0
GWeiToString turns a number of GWei in to a string. See WeiToString for details.
func StringToGWei ¶ added in v1.1.0
StringToGWei turns a string in to number of GWei. See StringToWei for details. Any part of the value below 1GWei in denomination is lost.
func StringToWei ¶
StringToWei turns a string in to number of Wei. The string can be a simple number of Wei, e.g. "1000000000000000" or it can be a number followed by a unit, e.g. "10 ether". Unit names are case-insensitive, and can be either given names (e.g. "finney") or metric names (e.g. "mlliether"). Note that this function expects use of the period as the decimal separator.
func UnitToMultiplier ¶
UnitToMultiplier takes the name of an Ethereum unit and returns a multiplier
from Wei
Example ¶
multiplier, err := string2eth.UnitToMultiplier("ether")
if err != nil {
return
}
fmt.Println(multiplier.Text(10))
Output: 1000000000000000000
Types ¶
This section is empty.