Round profit to 2dp

pull/243/head
Simon Roberts 3 years ago
parent 27fcf09513
commit 89ae72131b
No known key found for this signature in database
GPG Key ID: 0F30F99E6B771FD4

@ -346,9 +346,8 @@ func (ct *Cointop) GetPortfolioTable() *table.Table {
if coin.BuyPrice > 0 && coin.BuyCurrency != "" {
// TODO: currency conversion
profit := coin.Holdings * (coin.Price - coin.BuyPrice)
profit = math.Round(100*profit) / 100 // cheesy round
text = ct.FormatPrice(profit)
// text := strconv.FormatFloat(coin.Holdings, 'f', -1, 64)
}
if ct.State.hidePortfolioBalances {
text = HiddenBalanceChars

Loading…
Cancel
Save