add total value for card search filter
This commit is contained in:
parent
7f334e7680
commit
77f8fc78ca
@ -82,6 +82,7 @@ func Remove(cards []string) {
|
|||||||
|
|
||||||
func Cards(rarity, set string) {
|
func Cards(rarity, set string) {
|
||||||
|
|
||||||
|
var total float64
|
||||||
client := storage_connect()
|
client := storage_connect()
|
||||||
coll := &Collection{client.Database("serra").Collection("cards")}
|
coll := &Collection{client.Database("serra").Collection("cards")}
|
||||||
defer storage_disconnect(client)
|
defer storage_disconnect(client)
|
||||||
@ -105,7 +106,10 @@ func Cards(rarity, set string) {
|
|||||||
|
|
||||||
for _, card := range cards {
|
for _, card := range cards {
|
||||||
LogMessage(fmt.Sprintf("* %dx %s%s%s (%s/%s) %s%.2f EUR%s", card.SerraCount, Purple, card.Name, Reset, card.Set, card.CollectorNumber, Yellow, card.Prices.Eur, Reset), "normal")
|
LogMessage(fmt.Sprintf("* %dx %s%s%s (%s/%s) %s%.2f EUR%s", card.SerraCount, Purple, card.Name, Reset, card.Set, card.CollectorNumber, Yellow, card.Prices.Eur, Reset), "normal")
|
||||||
|
total = total + card.Prices.Eur*float64(card.SerraCount)
|
||||||
}
|
}
|
||||||
|
fmt.Printf("\nTotal Value: %s%.2f EUR%s\n", Yellow, total, Reset)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func ShowCard(cardids []string) {
|
func ShowCard(cardids []string) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user