diff --git a/website/src/components/ReviewPage/ReviewCard.tsx b/website/src/components/ReviewPage/ReviewCard.tsx index 1d4c5215c..149dab3d1 100644 --- a/website/src/components/ReviewPage/ReviewCard.tsx +++ b/website/src/components/ReviewPage/ReviewCard.tsx @@ -197,16 +197,18 @@ const isAnnotationPresent = (metadataField: string) => (item: ProcessingAnnotati const MetadataList: FC = ({ data, isLoading }) => !isLoading && - Object.entries(data.processedData.metadata).map(([metadataName, value], index) => ( - - )); + Object.entries(data.processedData.metadata).map(([metadataName, value], index) => + value === null ? null : ( + + ), + ); type ErrorsProps = { errors: ProcessingAnnotation[]; diff --git a/website/src/utils/displayMetadataField.ts b/website/src/utils/displayMetadataField.ts index 74b84460d..3a72fa16b 100644 --- a/website/src/utils/displayMetadataField.ts +++ b/website/src/utils/displayMetadataField.ts @@ -1,3 +1,17 @@ import type { MetadataField } from '../types/backend.ts'; -export const displayMetadataField = (value: MetadataField) => (value === null ? 'null' : value.toString()); +export const displayMetadataField = (value: MetadataField) => { + if (value === null) { + return 'null'; + } + + if (typeof value === 'number' && Number.isInteger(value)) { + return value.toString(); + } + + if (typeof value === 'number') { + return value.toFixed(2); + } + + return value.toString(); +};