fix(shopping): requireOnline-Guards + 2-space indent
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 3m14s

This commit is contained in:
hsiegeln
2026-04-21 23:59:14 +02:00
parent 52bb83cbd5
commit a15390f4b8
3 changed files with 30 additions and 24 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+$/, '');
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+$/, '');
}