From 886afab1efa826237a17404c67445c533de98596 Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Wed, 30 Apr 2025 20:05:38 +0200 Subject: [PATCH] styling, graph sizing and number precision --- src/app/components/FireCalculatorForm.tsx | 48 ++++++++++------------- src/app/page.tsx | 4 +- 2 files changed, 22 insertions(+), 30 deletions(-) diff --git a/src/app/components/FireCalculatorForm.tsx b/src/app/components/FireCalculatorForm.tsx index 253abe1..cbcdc43 100644 --- a/src/app/components/FireCalculatorForm.tsx +++ b/src/app/components/FireCalculatorForm.tsx @@ -368,8 +368,8 @@ export default function FireCalculatorForm() { }; return ( -
- + <> + FIRE Calculator @@ -541,7 +541,7 @@ export default function FireCalculatorForm() { {result && ( -
+
{result.error ? ( @@ -559,11 +559,9 @@ export default function FireCalculatorForm() { -
-

- {formatNumber(result.fireNumber)} -

-
+

+ {formatNumber(result.fireNumber)} +

@@ -575,11 +573,9 @@ export default function FireCalculatorForm() { -
-

- {result.retirementAge ?? "N/A"} -

-
+

+ {result.retirementAge ?? "N/A"} +

@@ -592,11 +588,9 @@ export default function FireCalculatorForm() { -
-

- {formatNumber(result.inflationAdjustedAllowance)} -

-
+

+ {formatNumber(result.inflationAdjustedAllowance)} +

)} @@ -610,11 +604,9 @@ export default function FireCalculatorForm() { -
-

- {result.retirementYears} -

-
+

+ {result.retirementYears} +

)} @@ -633,7 +625,7 @@ export default function FireCalculatorForm() { { if (value >= 1000000) { - return `${(value / 1000000).toFixed(1)}M`; + return `${(value / 1000000).toPrecision(3)}M`; } else if (value >= 1000) { - return `${(value / 1000).toFixed(0)}K`; + return `${(value / 1000).toPrecision(3)}K`; } return value.toString(); }} - width={80} + width={25} /> { @@ -742,6 +734,6 @@ export default function FireCalculatorForm() { )} -
+ ); } diff --git a/src/app/page.tsx b/src/app/page.tsx index bde408d..8dea5f3 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -10,7 +10,7 @@ import { export default function HomePage() { return (
-
+
{/* Added SEO Content Sections */} -
+

What is FIRE? Understanding Financial Independence and Early