From 056213f42a0941d96006ebaf57fabf6580285300 Mon Sep 17 00:00:00 2001 From: Jen Breese-Kauth Date: Tue, 5 May 2026 13:44:19 -0700 Subject: [PATCH 1/3] stash --- app/interactives/compounding-frequency-calculator/page.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/interactives/compounding-frequency-calculator/page.tsx b/app/interactives/compounding-frequency-calculator/page.tsx index 1f89222..b941d50 100644 --- a/app/interactives/compounding-frequency-calculator/page.tsx +++ b/app/interactives/compounding-frequency-calculator/page.tsx @@ -211,7 +211,7 @@ export default function CompoundInterestCalculator() { Compounding Frequency Number of
Compounding Periods Final Amount - Interest Earned + Interest Accrued @@ -223,12 +223,11 @@ export default function CompoundInterestCalculator() { {result.label} {Number(result.totalPeriods.toFixed(2))} {formatCurrency(result.finalAmount)} - {formatCurrency(result.interestEarned)} + {formatCurrency(result.interestEarned)} ))} -

Over the same time period, more frequent compounding generally results in more interest earned, assuming the annual interest rate stays the same.

From 796ac50c6c892d17c1ac7850b3d16318da261aef Mon Sep 17 00:00:00 2001 From: Jen Breese-Kauth Date: Tue, 5 May 2026 16:26:55 -0700 Subject: [PATCH 2/3] IFDM-158: Client feedback fixes --- .../compounding-frequency-calculator/page.tsx | 54 +++++++++---------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/app/interactives/compounding-frequency-calculator/page.tsx b/app/interactives/compounding-frequency-calculator/page.tsx index b941d50..2d7177f 100644 --- a/app/interactives/compounding-frequency-calculator/page.tsx +++ b/app/interactives/compounding-frequency-calculator/page.tsx @@ -29,10 +29,6 @@ function formatCurrency(value: number): string { }).format(value) } -function formatNumber(value: number): string { - return Math.round(value).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") -} - function calculateCompoundInterest( principal: number, rate: number, @@ -46,19 +42,6 @@ function calculateCompoundInterest( return { finalAmount, interestEarned, totalPeriods } } -function formatTimePeriod(totalPeriods: number, periodsPerYear: number): string { - const totalYears = totalPeriods / periodsPerYear - const years = Math.floor(totalYears) - const remainingPeriods = totalPeriods - (years * periodsPerYear) - const months = Math.round((remainingPeriods / periodsPerYear) * 12) - - if (years === 0 && months === 0) return "0 months" - if (years === 0) return `${months} month${months !== 1 ? 's' : ''}` - if (months === 0) return `${years} year${years !== 1 ? 's' : ''}` - - return `${years} year${years !== 1 ? 's' : ''} and ${months} month${months !== 1 ? 's' : ''}` -} - export default function CompoundInterestCalculator() { const [initialAmount, setInitialAmount] = useState("") const [annualRate, setAnnualRate] = useState("") @@ -78,11 +61,6 @@ export default function CompoundInterestCalculator() { return calculateCompoundInterest(principal, rate, totalPeriods, selectedOption.periodsPerYear) }, [principal, rate, totalPeriods, selectedOption.periodsPerYear]) - const formattedTimePeriod = useMemo(() => - formatTimePeriod(totalPeriods, selectedOption.periodsPerYear), - [totalPeriods, selectedOption.periodsPerYear] - ) - const comparisonResults = useMemo(() => { const timeInYears = totalPeriods / selectedOption.periodsPerYear return compoundingOptions.map((option) => { @@ -152,9 +130,6 @@ export default function CompoundInterestCalculator() { className="font-bold block w-full rounded-md shadow-sm py-2 px-3 border pr-10 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none" min="0" /> -

- {totalPeriods > 0 && `${formatNumber(totalPeriods)} ${selectedOption.label.toLowerCase()} periods = ${formattedTimePeriod}`} -

@@ -185,9 +160,29 @@ export default function CompoundInterestCalculator() { {/* Results Section */} -

Balance after {formattedTimePeriod}

+

Balance after {periods} + { + selectedCompounding === 'daily' ? ' days' : + selectedCompounding === 'weekly' ? ' weeks' : + selectedCompounding === 'biweekly' ? ' bi-weekly periods' : + selectedCompounding === 'monthly' ? ' months' : + selectedCompounding === 'quarterly' ? ' quarters' : + selectedCompounding === 'semi-annually' ? ' semi-annual periods' : + selectedCompounding === 'annually' ? ' years' : + selectedCompounding} +

{formatCurrency(selectedResult.finalAmount)}

-

Interest Earned over {formattedTimePeriod}

+

Interest accrued over {periods} + { + selectedCompounding === 'daily' ? ' days' : + selectedCompounding === 'weekly' ? ' weeks' : + selectedCompounding === 'biweekly' ? ' bi-weekly periods' : + selectedCompounding === 'monthly' ? ' months' : + selectedCompounding === 'quarterly' ? ' quarters' : + selectedCompounding === 'semi-annually' ? ' semi-annual periods' : + selectedCompounding === 'annually' ? ' years' : + selectedCompounding} +

{formatCurrency(selectedResult.interestEarned)}

@@ -211,7 +206,7 @@ export default function CompoundInterestCalculator() { Compounding Frequency Number of
Compounding Periods Final Amount - Interest Accrued + Interest Earned @@ -223,11 +218,12 @@ export default function CompoundInterestCalculator() { {result.label} {Number(result.totalPeriods.toFixed(2))} {formatCurrency(result.finalAmount)} - {formatCurrency(result.interestEarned)} + {formatCurrency(result.interestEarned)} ))} +

Over the same time period, more frequent compounding generally results in more interest accrued, assuming the annual interest rate stays the same.

From 157780a44971d88cbda8b475c853334ae4a38ffa Mon Sep 17 00:00:00 2001 From: Jen Breese-Kauth Date: Wed, 6 May 2026 15:34:30 -0700 Subject: [PATCH 3/3] fixup per review --- app/interactives/compounding-frequency-calculator/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/interactives/compounding-frequency-calculator/page.tsx b/app/interactives/compounding-frequency-calculator/page.tsx index 2d7177f..2eab048 100644 --- a/app/interactives/compounding-frequency-calculator/page.tsx +++ b/app/interactives/compounding-frequency-calculator/page.tsx @@ -206,7 +206,7 @@ export default function CompoundInterestCalculator() { Compounding Frequency Number of
Compounding Periods Final Amount - Interest Earned + Interest Accrued