Use zero Numeric for export instead of hardcoding 0,00
This commit is contained in:
@ -43,8 +43,8 @@ func (ynab *YNABExport) ExportAssignments(context context.Context, w io.Writer)
|
||||
assignment.Group,
|
||||
assignment.Category,
|
||||
assignment.Amount.String() + "€",
|
||||
"0,00€",
|
||||
"0,00€",
|
||||
NewZeroNumeric().String() + "€",
|
||||
NewZeroNumeric().String() + "€",
|
||||
}
|
||||
|
||||
err := csv.Write(row)
|
||||
@ -129,9 +129,9 @@ func GetTransactionRow(transaction GetAllTransactionsForBudgetRow) []string {
|
||||
row = append(row, transaction.Memo)
|
||||
|
||||
if transaction.Amount.IsPositive() {
|
||||
row = append(row, "0,00€", transaction.Amount.String()+"€")
|
||||
row = append(row, NewZeroNumeric().String()+"€", transaction.Amount.String()+"€")
|
||||
} else {
|
||||
row = append(row, transaction.Amount.String()[1:]+"€", "0,00€")
|
||||
row = append(row, transaction.Amount.String()[1:]+"€", NewZeroNumeric().String()+"€")
|
||||
}
|
||||
|
||||
return append(row, string(transaction.Status))
|
||||
|
Reference in New Issue
Block a user