typesafe format for numbers

This commit is contained in:
proddy
2024-05-18 08:55:59 +02:00
parent e87ad5db2d
commit 43476f41df
2 changed files with 2 additions and 1 deletions

View File

@@ -640,6 +640,7 @@ const Devices: FC = () => {
{me.admin && ( {me.admin && (
<IconButton onClick={customize}> <IconButton onClick={customize}>
<FormatListNumberedIcon <FormatListNumberedIcon
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }} sx={{ fontSize: 18, verticalAlign: 'middle' }}
/> />
</IconButton> </IconButton>

View File

@@ -31,7 +31,7 @@ export function formatValue(
uom: DeviceValueUOM uom: DeviceValueUOM
) { ) {
if (typeof value !== 'number') { if (typeof value !== 'number') {
return value; return (value === undefined ? '' : value) as string;
} }
switch (uom) { switch (uom) {
case DeviceValueUOM.HOURS: case DeviceValueUOM.HOURS: