Add showing currency symbol for card name if it is possible

This commit is contained in:
qowevisa 2024-11-24 11:33:42 +02:00
parent 46ab4ee7a0
commit d61d083ed6

View File

@ -12,8 +12,10 @@ import (
var cardTransform func(inp *db.Card) types.DbCard = func(inp *db.Card) types.DbCard {
var curr types.DbCurrency
symbolPostfixForCard := ""
if inp.Currency != nil {
curr = currencyTransform(inp.Currency)
symbolPostfixForCard = fmt.Sprintf(" (%s)", inp.Currency.Symbol)
} else {
curr = types.DbCurrency{}
}
@ -26,7 +28,7 @@ var cardTransform func(inp *db.Card) types.DbCard = func(inp *db.Card) types.DbC
LastDigits: inp.LastDigits,
CurrencyID: inp.CurrencyID,
Currency: curr,
DisplayName: fmt.Sprintf("%s •%s", inp.Name, inp.LastDigits),
DisplayName: fmt.Sprintf("%s •%s%s", inp.Name, inp.LastDigits, symbolPostfixForCard),
}
}