feat(format): formatQuantity app-weit auf de-DE Komma-Dezimal
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 2m19s

Ersetzt Math.round/toFixed-Logik durch q.toLocaleString('de-DE', …).
Dezimaltrennzeichen ist jetzt konsistent ein Komma (0,5 statt 0.5).
Tests aktualisiert; alle 316 Tests + svelte-check grün.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-22 16:55:29 +02:00
parent b85f869c09
commit 14cf1b1d35
2 changed files with 8 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
export function formatQuantity(q: number | null): string {
if (q === null || q === undefined) return '';
const rounded = Math.round(q);
if (Math.abs(q - rounded) < 0.01) return String(rounded);
// auf max. 2 Nachkommastellen, trailing Nullen raus
return q.toFixed(2).replace(/\.?0+$/, '');
return q.toLocaleString('de-DE', {
maximumFractionDigits: 2,
useGrouping: false
});
}