Add +-1000 spinner buttons to amount fields, floor (not round) to nearest 1000 in all allocation calculations
Deploy App / deploy (push) Successful in 45s

This commit is contained in:
2026-07-08 20:40:54 +02:00
parent 3b68ff8319
commit fb57ec5549
4 changed files with 75 additions and 36 deletions
+6 -4
View File
@@ -10,10 +10,12 @@ export function formatChf(value: number): string {
return sign + withSeparators;
}
// Rundet auf ein Vielfaches von 1'000 -- Betraege unter 1'000 CHF sind fuer dieses
// Planungstool nicht relevant.
export function roundToThousand(value: number): number {
return Math.round((value || 0) / 1000) * 1000;
// Rundet ABwaerts auf ein Vielfaches von 1'000. Bewusst floor statt round: Betraege wie
// z. B. eine verfuegbare Sparquote von 1'450 CHF liessen sich sonst nicht vollstaendig
// auf Wertschriften verteilen (nur 1'000er-Schritte moeglich) -- durch Abrunden bleibt
// der angezeigte/verplanbare Betrag immer tatsaechlich erreichbar.
export function floorToThousand(value: number): number {
return Math.floor((value || 0) / 1000) * 1000;
}
export function parseChfInput(text: string): number {