Skip to content

Commit

Permalink
feat: swapped avg cost and quantity
Browse files Browse the repository at this point in the history
  • Loading branch information
achannarasappa committed Apr 6, 2021
1 parent 3808037 commit 3a65194
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ Stock 2 Inc. (loss) 52wk Range: 0.00 - 150.00 Open:
STOCK3Day Range: 90.00 - 120.00 Prev. Close: 100.00 105.00
Stock 3 Inc. (gain, 52wk Range: 0.00 - 150.00 Open: 110.005.00 (5.00%)
Real-Time
STOCK4Day Range: 90.00 - 120.00 Prev. Close: 100.00 Quantity: 100.00 105.00 (0.00%) 105.00
Stock 4 Inc. (positi 52wk Range: 0.00 - 150.00 Open: 110.00 Avg. Cost: 0.0055.00 (110.00%) ↑ 5.00 (5.00%)
STOCK4Day Range: 90.00 - 120.00 Prev. Close: 100.00 Avg. Cost: 0.00 105.00 (0.00%) 105.00
Stock 4 Inc. (positi 52wk Range: 0.00 - 150.00 Open: 110.00 Quantity: 100.0055.00 (110.00%) ↑ 5.00 (5.00%)
Real-Time
STOCK5Day Range: 90.00 - 120.00 Prev. Close: 100.00 Quantity: 100.00 105.00 (0.00%) 105.00
Stock 5 Inc. (positi 52wk Range: 0.00 - 150.00 Open: 110.00 Avg. Cost: 0.00-45.00 (-30.00%) ↑ 5.00 (5.00%)
STOCK5Day Range: 90.00 - 120.00 Prev. Close: 100.00 Avg. Cost: 0.00 105.00 (0.00%) 105.00
Stock 5 Inc. (positi 52wk Range: 0.00 - 150.00 Open: 110.00 Quantity: 100.00-45.00 (-30.00%) ↑ 5.00 (5.00%)
Real-Time
STOCK6Day Range: 90.00 - 120.00 Prev. Close: 100.00 Quantity: 100.00 95.00 (0.00%) 95.00
Stock 6 Inc. (positi 52wk Range: 0.00 - 150.00 Open: 110.00 Avg. Cost: 0.00-55.00 (-36.67%) ↓ -5.00 (-5.00%)
STOCK6Day Range: 90.00 - 120.00 Prev. Close: 100.00 Avg. Cost: 0.00 95.00 (0.00%) 95.00
Stock 6 Inc. (positi 52wk Range: 0.00 - 150.00 Open: 110.00 Quantity: 100.00-55.00 (-36.67%) ↓ -5.00 (-5.00%)
Real-Time
STOCK7Day Range: 90.00 - 120.00 Prev. Close: 100.00 Quantity: 100.00 95.00 (0.00%) 95.00
Stock 7 Inc. (positi 52wk Range: 0.00 - 0.00 Open: 110.00 Avg. Cost: 0.0045.00 (90.00%) ↓ -5.00 (-5.00%)
STOCK7Day Range: 90.00 - 120.00 Prev. Close: 100.00 Avg. Cost: 0.00 95.00 (0.00%) 95.00
Stock 7 Inc. (positi 52wk Range: 0.00 - 0.00 Open: 110.00 Quantity: 100.0045.00 (90.00%) ↓ -5.00 (-5.00%)
Real-Time
STOCK8 Day Range: 90.00 - 120.00 Prev. Close: 100.00 Quantity: 100.00 95.00 (0.00%) 95.00
Stock 8 Inc. (positi 52wk Range: 0.00 - 0.00 Open: 110.00 Avg. Cost: 0.0045.00 (90.00%) 0.00 (0.00%)
STOCK8 Day Range: 90.00 - 120.00 Prev. Close: 100.00 Avg. Cost: 0.00 95.00 (0.00%) 95.00
Stock 8 Inc. (positi 52wk Range: 0.00 - 0.00 Open: 110.00 Quantity: 100.0045.00 (90.00%) 0.00 (0.00%)
Real-Time
8 changes: 4 additions & 4 deletions internal/ui/component/watchlist/watchlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@ func textPositionExtended(quote Quote, position Position, styles c.Styles) strin
return ""
}

return styles.Text(ConvertFloatToString(position.Quantity, quote.IsVariablePrecision)) +
return styles.Text(ConvertFloatToString(position.AverageCost, quote.IsVariablePrecision)) +
"\n" +
styles.Text(ConvertFloatToString(position.AverageCost, quote.IsVariablePrecision))
styles.Text(ConvertFloatToString(position.Quantity, quote.IsVariablePrecision))

}

Expand All @@ -322,9 +322,9 @@ func textPositionExtendedLabels(position Position, styles c.Styles) string {
return ""
}

return styles.TextLabel("Quantity:") +
return styles.TextLabel("Avg. Cost:") +
"\n" +
styles.TextLabel("Avg. Cost:")
styles.TextLabel("Quantity:")
}

func textQuoteRange(quote Quote, styles c.Styles) string {
Expand Down

0 comments on commit 3a65194

Please sign in to comment.