mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
typesafe format for numbers
This commit is contained in:
@@ -640,6 +640,7 @@ const Devices: FC = () => {
|
||||
{me.admin && (
|
||||
<IconButton onClick={customize}>
|
||||
<FormatListNumberedIcon
|
||||
color="primary"
|
||||
sx={{ fontSize: 18, verticalAlign: 'middle' }}
|
||||
/>
|
||||
</IconButton>
|
||||
|
||||
@@ -31,7 +31,7 @@ export function formatValue(
|
||||
uom: DeviceValueUOM
|
||||
) {
|
||||
if (typeof value !== 'number') {
|
||||
return value;
|
||||
return (value === undefined ? '' : value) as string;
|
||||
}
|
||||
switch (uom) {
|
||||
case DeviceValueUOM.HOURS:
|
||||
|
||||
Reference in New Issue
Block a user