Skip to content

Commit

Permalink
update market bar
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmota committed Mar 31, 2018
1 parent 04df158 commit 0b40542
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Binary file modified assets/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bin/cointop
Binary file not shown.
4 changes: 2 additions & 2 deletions cointop/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (ct *Cointop) chartPoints(maxX int, coin string) error {

now := time.Now()
secs := now.Unix()
start := secs - oneDay
start := secs - oneWeek
end := secs

_ = coin
Expand All @@ -52,7 +52,7 @@ func (ct *Cointop) chartPoints(maxX int, coin string) error {
}
*/
for i := range graphData.MarketCapByAvailableSupply {
data = append(data, graphData.MarketCapByAvailableSupply[i][1])
data = append(data, graphData.MarketCapByAvailableSupply[i][1]/1E9)
}
chart.Data = data
termui.Body = termui.NewGrid()
Expand Down
3 changes: 2 additions & 1 deletion cointop/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func (ct *Cointop) updateMarket() error {
if err != nil {
return err
}
fmt.Fprintln(ct.marketview, pad.Right(fmt.Sprintf("%s Total Market Cap: %s • 24H Volume: %s • BTC Dominance: %.2f%% • Active Currencies: %s • Active Assets: %s • Active Markets: %s", color.Cyan("cointop"), color.WhiteBold(humanize.Commaf(market.TotalMarketCapUSD)), humanize.Commaf(market.Total24HVolumeUSD), market.BitcoinPercentageOfMarketCap, humanize.Comma(int64(market.ActiveCurrencies)), humanize.Comma(int64(market.ActiveAssets)), humanize.Comma(int64(market.ActiveMarkets))), maxX, " "))
timeframe := "7 Day"
fmt.Fprintln(ct.marketview, pad.Right(fmt.Sprintf("%s Chart: %s • Total Market Cap: %s • 24H Volume: %s • BTC Dominance: %.2f%% • Active Currencies: %s • Active Markets: %s", color.Cyan("cointop"), timeframe, color.WhiteBold(humanize.Commaf(market.TotalMarketCapUSD)), humanize.Commaf(market.Total24HVolumeUSD), market.BitcoinPercentageOfMarketCap, humanize.Comma(int64(market.ActiveCurrencies)), humanize.Comma(int64(market.ActiveMarkets))), maxX, " "))
return nil
}

0 comments on commit 0b40542

Please sign in to comment.