Add +-1000 spinner buttons to amount fields, floor (not round) to nearest 1000 in all allocation calculations
Deploy App / deploy (push) Successful in 45s
Deploy App / deploy (push) Successful in 45s
This commit is contained in:
+6
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user