Skip to content

Commit

Permalink
Merge pull request #323 from jembi/CU-86c0aptvn_Beta-F-score-rounding
Browse files Browse the repository at this point in the history
updated format value function
  • Loading branch information
martino-jembi authored Sep 16, 2024
2 parents 16dfdd4 + bfb2604 commit e75b4ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import React from 'react';
import { Box, Grid } from '@mui/material';
import CountWidget from './CountWidgetWidget';
import React from 'react'
import { Box, Grid } from '@mui/material'
import CountWidget from './CountWidgetWidget'

interface DataProps {
precision?: number;
recall_precision?: number;
recall?: number;
precision?: number
recall_precision?: number
recall?: number
}

interface BetaFscoreWidgetProps {
data: DataProps;
data: DataProps
}

function BetaFscoreWidget({ data }: BetaFscoreWidgetProps) {
const formatValue = (value: number | undefined): number =>
Number.isFinite(value) ? Number(value?.toFixed(5)) : 0;
const formatValue = (value?: number): string => {
if (value === undefined || !Number.isFinite(value)) {
return '0.00000'
}
return value.toFixed(5)
}

return (
<Box component="fieldset">
Expand All @@ -40,7 +44,7 @@ function BetaFscoreWidget({ data }: BetaFscoreWidgetProps) {
</Grid>
</Grid>
</Box>
);
)
}

export default BetaFscoreWidget;
export default BetaFscoreWidget
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react'

type countWidgetType = {
label: string
value: number
value: string
icon?: React.ReactElement
iconBackgroundColor?: string
secondValue?: number
Expand Down

0 comments on commit e75b4ad

Please sign in to comment.