mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-10 17:59:53 +03:00
improve dv validation, add back ugly step
This commit is contained in:
@@ -54,23 +54,3 @@ export function formatValue(LL: TranslationFunctions, value: any, uom: number) {
|
||||
return new Intl.NumberFormat().format(value) + ' ' + DeviceValueUOM_s[uom];
|
||||
}
|
||||
}
|
||||
|
||||
export const formatValueNoUOM = (value: any, uom: number) => {
|
||||
if (value === undefined) {
|
||||
return '';
|
||||
}
|
||||
|
||||
switch (uom) {
|
||||
case DeviceValueUOM.NONE:
|
||||
if (typeof value === 'number') {
|
||||
return Number(value);
|
||||
}
|
||||
return value;
|
||||
case DeviceValueUOM.DEGREES:
|
||||
case DeviceValueUOM.DEGREES_R:
|
||||
case DeviceValueUOM.FAHRENHEIT:
|
||||
return Number(value).toFixed(1);
|
||||
default:
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user