fix: use symmetric rounding for negative amounts in formatGermanAmount
This commit is contained in:
@@ -155,4 +155,15 @@ describe('buildCsv', () => {
|
||||
'2026-08-05;Zahlung;Alex Muster;Test;1,01;1,01',
|
||||
);
|
||||
});
|
||||
|
||||
it('rounds negative half-cent boundaries correctly', () => {
|
||||
const csv = buildCsv([
|
||||
{ date: '2026-08-05T00:00:00.000Z', type: 'expense', who: 'Teamkasse', note: 'Test', amount: -1.005, runningTotal: -1.005 },
|
||||
]);
|
||||
|
||||
expect(csv).toBe(
|
||||
'Datum;Typ;Wer;Notiz;Betrag;Periodensaldo\r\n' +
|
||||
'2026-08-05;Ausgabe;Teamkasse;Test;-1,01;-1,01',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user