merge changes from Michael for #600

This commit is contained in:
Proddy
2023-04-30 20:35:29 +02:00
parent c34208c3df
commit 8a01a1e471
2 changed files with 8 additions and 6 deletions

View File

@@ -199,10 +199,12 @@ const SettingsEntities: FC = () => {
setDialogOpen(true);
};
function formatValue(value: any, uom: any) {
function formatValue(value: any, uom: number) {
return value === undefined || uom === undefined
? ''
: new Intl.NumberFormat().format(value) + (uom === 0 ? '' : ' ' + DeviceValueUOM_s[uom]);
: typeof value === 'number'
? new Intl.NumberFormat().format(value) + (uom === 0 ? '' : ' ' + DeviceValueUOM_s[uom])
: value;
}
function showHex(value: number, digit: number) {