mirror of https://github.com/miguelmota/cointop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
418 B
Go
19 lines
418 B
Go
package cointop
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
humanize "github.com/dustin/go-humanize"
|
|
"github.com/miguelmota/cointop/pkg/pad"
|
|
)
|
|
|
|
func (ct *Cointop) updateMarket() error {
|
|
maxX, _ := ct.g.Size()
|
|
market, err := ct.api.GetGlobalMarketData()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
fmt.Fprintln(ct.marketview, pad.Right(fmt.Sprintf("%10.stotal market cap: %s", "", humanize.Commaf(market.TotalMarketCapUSD)), maxX, " "))
|
|
return nil
|
|
}
|