matrixsrs / ethunitconv

Ethereum Wei unit Converter

Home Page:http://it-byte.pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ethunitconv

Build Status Go Report Card

Ethereum Wei unit Converter

Features

Convert all Ether units http://ethdocs.org/en/latest/ether.html

Install

go get -v github.com/savier89/ethunitconv

Usage

package main

import (
	"fmt"

	"github.com/savier89/ethunitconv"
)

func main() {
	ether := ethunitconv.FromWei("418160973408927260000000000", "Ether")
	fmt.Println(ether)
	ether2wei := ethunitconv.ToWei(ether, "Ether")
	fmt.Println(ether2wei)
}

Output

$ go run main.go
418160973.4089272600
418160973408927259994095616

$ go test -v
=== RUN   TestConverter
418160973.4089272600
418160973408927259994095616
--- PASS: TestConverter (0.00s)
PASS
ok      github.com/savier89/ethunitconv	0.001s

Donate

You can help fund the developer by donating to the following wallet addresses:

BTC: 1HhcW3NjAswZPGBmHo1Kcr2JPA3cfn1bA6
ETH: 0xF9E93f163E8Bd606BD36CA2D177C345750C66241
CLO: 0x9c0B6195092780963ef2EB978C4b2E1d2f375Bb4

About

Ethereum Wei unit Converter

http://it-byte.pro

License:MIT License


Languages

Language:Go 100.0%