From bfb260405054397b52ba6814ac98fba3e0030801 Mon Sep 17 00:00:00 2001 From: NyashaMuusha Date: Mon, 16 Sep 2024 13:37:28 +0200 Subject: [PATCH] updated beta f score --- .../components/dashboard/widgets/BetaFscoreWidget.tsx | 10 ++++++---- .../components/dashboard/widgets/CountWidgetWidget.tsx | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/JeMPI_Apps/JeMPI_UI/src/components/dashboard/widgets/BetaFscoreWidget.tsx b/JeMPI_Apps/JeMPI_UI/src/components/dashboard/widgets/BetaFscoreWidget.tsx index dcc244e12..201591369 100644 --- a/JeMPI_Apps/JeMPI_UI/src/components/dashboard/widgets/BetaFscoreWidget.tsx +++ b/JeMPI_Apps/JeMPI_UI/src/components/dashboard/widgets/BetaFscoreWidget.tsx @@ -13,10 +13,12 @@ interface BetaFscoreWidgetProps { } function BetaFscoreWidget({ data }: BetaFscoreWidgetProps) { - const formatValue = (value?: number): number => - value !== undefined && Number.isFinite(value) - ? parseFloat(value.toFixed(5)) - : 0 + const formatValue = (value?: number): string => { + if (value === undefined || !Number.isFinite(value)) { + return '0.00000' + } + return value.toFixed(5) + } return ( diff --git a/JeMPI_Apps/JeMPI_UI/src/components/dashboard/widgets/CountWidgetWidget.tsx b/JeMPI_Apps/JeMPI_UI/src/components/dashboard/widgets/CountWidgetWidget.tsx index 1d77296e2..79852fdb1 100644 --- a/JeMPI_Apps/JeMPI_UI/src/components/dashboard/widgets/CountWidgetWidget.tsx +++ b/JeMPI_Apps/JeMPI_UI/src/components/dashboard/widgets/CountWidgetWidget.tsx @@ -3,7 +3,7 @@ import React from 'react' type countWidgetType = { label: string - value: number + value: string icon?: React.ReactElement iconBackgroundColor?: string secondValue?: number