Ethereum unit converter written in go.
go get github.com/jon4hz/ethconvert/pkg/ethconvert
package main
import (
"fmt"
"github.com/jon4hz/ethconvert/pkg/ethconvert"
"github.com/shopspring/decimal"
)
func main() {
amount := decimal.NewFromInt(50)
gwei, err := ethconvert.Convert(amount, "ether", "gwei")
if err != nil {
panic(err)
}
fmt.Println(gwei)
}
go install github.com/jon4hz/ethconvert/cmd/ethconvert@latest
$ ethconvert -i ether -o wei -a 1
1000000000000000000 wei
$ ethconvert 50 wei gwei
0.00000005 gwei