aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/common.go20
-rw-r--r--ethutil/config.go2
2 files changed, 14 insertions, 8 deletions
diff --git a/ethutil/common.go b/ethutil/common.go
index 771dfc723..c7973eb92 100644
--- a/ethutil/common.go
+++ b/ethutil/common.go
@@ -7,13 +7,15 @@ import (
// The different number of units
var (
- Ether = BigPow(10, 18)
- Finney = BigPow(10, 15)
- Szabo = BigPow(10, 12)
- Shannon = BigPow(10, 9)
- Babbage = BigPow(10, 6)
- Ada = BigPow(10, 3)
- Wei = big.NewInt(1)
+ Douglas = BigPow(10, 42)
+ Einstein = BigPow(10, 21)
+ Ether = BigPow(10, 18)
+ Finney = BigPow(10, 15)
+ Szabo = BigPow(10, 12)
+ Shannon = BigPow(10, 9)
+ Babbage = BigPow(10, 6)
+ Ada = BigPow(10, 3)
+ Wei = big.NewInt(1)
)
// Currency to string
@@ -21,6 +23,10 @@ var (
// Returns a string representing a human readable format
func CurrencyToString(num *big.Int) string {
switch {
+ case num.Cmp(Douglas) >= 0:
+ return fmt.Sprintf("%v Douglas", new(big.Int).Div(num, Douglas))
+ case num.Cmp(Einstein) >= 0:
+ return fmt.Sprintf("%v Einstein", new(big.Int).Div(num, Einstein))
case num.Cmp(Ether) >= 0:
return fmt.Sprintf("%v Ether", new(big.Int).Div(num, Ether))
case num.Cmp(Finney) >= 0:
diff --git a/ethutil/config.go b/ethutil/config.go
index 4f7820eed..e992bda12 100644
--- a/ethutil/config.go
+++ b/ethutil/config.go
@@ -75,7 +75,7 @@ func ReadConfig(base string, logTypes LoggerType, g *globalconf.GlobalConf, id s
if Config == nil {
path := ApplicationFolder(base)
- Config = &config{ExecPath: path, Debug: true, Ver: "0.5.0 RC11"}
+ Config = &config{ExecPath: path, Debug: true, Ver: "0.5.0 RC12"}
Config.conf = g
Config.Identifier = id
Config.Log = NewLogger(logTypes, LogLevelDebug)