diff --git a/cointop/marketbar.go b/cointop/marketbar.go index fb50cd3..3adf857 100644 --- a/cointop/marketbar.go +++ b/cointop/marketbar.go @@ -42,10 +42,6 @@ func (ct *Cointop) UpdateMarketbar() error { totalstr = humanize.Monetaryf(total, 2) } - if ct.State.hidePortfolioBalances { - totalstr = HiddenBalanceChars - } - timeframe := ct.State.selectedChartRange chartname := ct.SelectedCoinName() var charttitle string @@ -85,10 +81,15 @@ func (ct *Cointop) UpdateMarketbar() error { ) } + totalstr = fmt.Sprintf("%s%s", ct.CurrencySymbol(), totalstr) + if ct.State.hidePortfolioBalances { + totalstr = HiddenBalanceChars + } + content = fmt.Sprintf( "%sTotal Portfolio Value: %s • 24H: %s", chartInfo, - ct.colorscheme.MarketBarLabelActive(fmt.Sprintf("%s%s", ct.CurrencySymbol(), totalstr)), + ct.colorscheme.MarketBarLabelActive(totalstr), color24h(fmt.Sprintf("%.2f%%%s", percentChange24H, arrow)), ) } else { diff --git a/cointop/portfolio.go b/cointop/portfolio.go index 1a09560..656bc1e 100644 --- a/cointop/portfolio.go +++ b/cointop/portfolio.go @@ -145,6 +145,9 @@ func (ct *Cointop) GetPortfolioTable() *table.Table { }) case "holdings": text := strconv.FormatFloat(coin.Holdings, 'f', -1, 64) + if ct.State.hidePortfolioBalances { + text = HiddenBalanceChars + } ct.SetTableColumnWidthFromString(header, text) ct.SetTableColumnAlignLeft(header, false) rowCells = append(rowCells, @@ -272,6 +275,9 @@ func (ct *Cointop) GetPortfolioTable() *table.Table { percentHoldings = 0 } text := fmt.Sprintf("%.2f%%", percentHoldings) + if ct.State.hidePortfolioBalances { + text = HiddenBalanceChars + } ct.SetTableColumnWidthFromString(header, text) ct.SetTableColumnAlignLeft(header, false) rowCells = append(rowCells, @@ -773,6 +779,9 @@ func (ct *Cointop) PrintHoldingsTable(options *TablePrintOptions) error { } else { item[i] = strconv.FormatFloat(entry.Holdings, 'f', -1, 64) } + if hideBalances { + item[i] = HiddenBalanceChars + } case "balance": if humanReadable { item[i] = fmt.Sprintf("%s%s", symbol, humanize.Monetaryf(entry.Balance, 2)) @@ -794,6 +803,9 @@ func (ct *Cointop) PrintHoldingsTable(options *TablePrintOptions) error { } else { item[i] = fmt.Sprintf("%.2f", percentHoldings) } + if hideBalances { + item[i] = HiddenBalanceChars + } } } records[i] = item diff --git a/docs/content/faq.md b/docs/content/faq.md index feb1a56..a707c29 100644 --- a/docs/content/faq.md +++ b/docs/content/faq.md @@ -185,7 +185,7 @@ draft: false ## How do I hide my portfolio balances (private mode)? - You can run cointop with the `--hide-portfolio-balances` flag to toggle hide/show portfolio balances or use the keyboard shortcut Ctrl+space on the portfolio page. + You can run cointop with the `--hide-portfolio-balances` flag to hide portfolio balances or use the keyboard shortcut Ctrl+space on the portfolio page to toggle hide/show. ## I'm getting question marks or weird symbols instead of the correct characters.