Skip to content
general utilities to support my ethereum stuff
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ether_test.go
numbers.go
readme.md
strings.go

readme.md

Ether Utils

Generic utilities for messing around with ethereum because I get annoyed at trying to find my most recent copy of each of these....

StrToDecimals

  • convert a string (possibly with a decimal point) to the atomic unit based on the number of decimals expected
func StrToDecimals(value string, decimals int64) (vInEther *big.Int, ok bool)

StrToEther

  • Convert a string (possibly with a decimal point) to Wei
func StrToEther(value string) (vInEther *big.Int, ok bool)

EtherToStr

  • Convert a value (in wei) to an ether string
func EtherToStr(bbal *big.Int) string

CoinToString

  • Convert a value (in uCoins) to a Coin string
func CoinToStr(bbal *big.Int, numDec int) string

StrToDecimals

  • convert a string like "10.32" into the base units given the number of decimal places
You can’t perform that action at this time.