import { Box, LinearProgress, LinearProgressProps, Typography } from '@material-ui/core'; export function normalise(value: number, min: number, max: number) { return (Number(value) - Number(min)) * 100 / (Number(max) - Number(min)); } export function LinearProgressWithLabel(props: LinearProgressProps & { value: number; min: number; max: number; }) { return props.value > 0 ? (
{`${Math.round(normalise(props.value, props.min, props.max))}% (${props.value}/${props.max})`}
) : null; }