Rename GetActiveTableCompactNotation to IsActiveTableCompactNotation

pull/200/head
Simon Roberts 3 years ago
parent f595cd7055
commit ef5254523b
No known key found for this signature in database
GPG Key ID: 0F30F99E6B771FD4

@ -136,7 +136,7 @@ func (ct *Cointop) GetCoinsTable() *table.Table {
})
case "24h_volume":
text := humanize.Monetaryf(coin.Volume24H, 0)
if ct.GetActiveTableCompactNotation() {
if ct.IsActiveTableCompactNotation() {
text = humanize.ScaleNumericf(coin.Volume24H, 3)
}
ct.SetTableColumnWidthFromString(header, text)
@ -246,7 +246,7 @@ func (ct *Cointop) GetCoinsTable() *table.Table {
})
case "market_cap":
text := humanize.Monetaryf(coin.MarketCap, 0)
if ct.GetActiveTableCompactNotation() {
if ct.IsActiveTableCompactNotation() {
text = humanize.ScaleNumericf(coin.MarketCap, 3)
}
ct.SetTableColumnWidthFromString(header, text)
@ -261,7 +261,7 @@ func (ct *Cointop) GetCoinsTable() *table.Table {
})
case "total_supply":
text := humanize.Numericf(coin.TotalSupply, 0)
if ct.GetActiveTableCompactNotation() {
if ct.IsActiveTableCompactNotation() {
text = humanize.ScaleNumericf(coin.TotalSupply, 3)
}
ct.SetTableColumnWidthFromString(header, text)
@ -276,7 +276,7 @@ func (ct *Cointop) GetCoinsTable() *table.Table {
})
case "available_supply":
text := humanize.Numericf(coin.AvailableSupply, 0)
if ct.GetActiveTableCompactNotation() {
if ct.IsActiveTableCompactNotation() {
text = humanize.ScaleNumericf(coin.AvailableSupply, 3)
}
ct.SetTableColumnWidthFromString(header, text)

@ -131,8 +131,7 @@ var HeaderColumns = map[string]*HeaderColumn{
// GetLabel fetch the label to use for the heading (depends on configuration)
func (ct *Cointop) GetLabel(h *HeaderColumn) string {
// TODO: technically this should support nosort
compactNotation := ct.GetActiveTableCompactNotation()
if compactNotation && h.ShortLabel != "" {
if ct.IsActiveTableCompactNotation() && h.ShortLabel != "" {
return h.ShortLabel
}
return h.Label
@ -162,7 +161,7 @@ func (ct *Cointop) GetActiveTableHeaders() []string {
}
// GetActiveTableHeaders returns the list of active table headers
func (ct *Cointop) GetActiveTableCompactNotation() bool {
func (ct *Cointop) IsActiveTableCompactNotation() bool {
var compact bool
switch ct.State.selectedView {
case PortfolioView:

Loading…
Cancel
Save