Use zero Numeric for export instead of hardcoding 0,00
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-02-23 21:17:43 +00:00
parent 0478d82c1f
commit 6686904539
2 changed files with 27 additions and 16 deletions

View File

@ -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))