diff --git a/btc.go b/btc.go index 74e8665..0ba210a 100644 --- a/btc.go +++ b/btc.go @@ -17,6 +17,8 @@ func (w Watcher) ConvertBalance(balanceSat int) (float64, error) { currency := strings.ToUpper(w.Currency) bitcoinBalance := float64(balanceSat) / float64(SatsPerBitcoin) switch currency { + case "USD": + balanceFiat = price.USD * bitcoinBalance case "EUR": balanceFiat = price.EUR * bitcoinBalance case "GBP": diff --git a/main.go b/main.go index f8cc209..adaa63d 100644 --- a/main.go +++ b/main.go @@ -116,8 +116,7 @@ func main() { r.Static("/static", "web/static") r.GET("/", watcher.Home) - thing := ":" + fmt.Sprintf(watcher.Port) - err = r.Run(thing) + err = r.Run(":" + fmt.Sprintf(watcher.Port)) if err != nil { log.Fatal("could not start: ", err) } diff --git a/util.go b/util.go index 999e64a..10c290b 100644 --- a/util.go +++ b/util.go @@ -104,6 +104,9 @@ func (w Watcher) FillDefaults() { if w.Port == "" { watcher.Port = "80" } + if w.Currency == "" { + watcher.Currency = "USD" + } // Set up DB path // Create the folder path if it doesn't exist diff --git a/web/templates/pages/home.html b/web/templates/pages/home.html index 07b603d..c32ce95 100644 --- a/web/templates/pages/home.html +++ b/web/templates/pages/home.html @@ -2,7 +2,7 @@
-