first commit
Docker-Images bauen und veroeffentlichen / build-and-push (push) Failing after 1m32s

This commit is contained in:
Nick Szaunig committed 2026-09-27 06:06:56 +02:00
commit 59bb5a38a3
132 files changed
+19435

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
/** Alle Betraege sind ganzzahlige Cent in EUR. */
const eur = new Intl.NumberFormat("de-DE", {
style: "currency",
currency: "EUR",
minimumFractionDigits: 2,
maximumFractionDigits: 2,
});
/** 220000 -> "2.200,00 €" */
export function formatEuro(cents: number): string {
assertCents(cents);
// Intl setzt ein geschuetztes Leerzeichen vor das Eurozeichen; fuer
// E-Mails/CSV ist ein normales Leerzeichen robuster.
return eur.format(cents / 100).replace(/ /g, " ");
}
/** 220000 -> "2.200 €" (nur fuer glatte Betraege in Ueberschriften). */
export function formatEuroShort(cents: number): string {
assertCents(cents);
if (cents % 100 !== 0) return formatEuro(cents);
return `${new Intl.NumberFormat("de-DE").format(cents / 100)} €`;
}
export function assertCents(cents: number): void {
if (!Number.isSafeInteger(cents)) {
throw new Error(`Betrag muss ganzzahlige Cent sein, erhalten: ${cents}`);
}
}