From f224e98e0a6f07c1f7089a7fff3171f9af410d54 Mon Sep 17 00:00:00 2001 From: Manohar Gupta Date: Fri, 22 May 2026 16:53:51 +0530 Subject: [PATCH] Fix solver values to display as percentage not decimal - Added pct() helper function - Target Equity IRR now shows 18% instead of 0.18 - Input accepts percentage and converts back to decimal internally --- packages/web/components/ScenarioWizard.tsx | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/packages/web/components/ScenarioWizard.tsx b/packages/web/components/ScenarioWizard.tsx index 337ac1e..eb238ba 100644 --- a/packages/web/components/ScenarioWizard.tsx +++ b/packages/web/components/ScenarioWizard.tsx @@ -4,6 +4,11 @@ import { useState } from "react"; import { Button } from "@/components/ui/button"; import type { ScenarioInputPayload } from "@/lib/api"; +// Helper to convert decimal to percentage display +function pct(raw: number): number { + return parseFloat((raw * 100).toFixed(2)); +} + const LOCATION_OPTIONS = [ { value: "RJ", label: "Rajasthan (High Solar)" }, { value: "GJ", label: "Gujarat (High Solar)" }, @@ -359,14 +364,18 @@ function StepSolver({ /> {state.solver_mode === "solve_tariff" ? ( - - set("target_irr", Number(v))} - /> + +
+ set("target_irr", Number(v) / 100)} + /> + % +
) : (