mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
ignore internationl number settings when changing value
This commit is contained in:
@@ -63,15 +63,13 @@ export const formatValueNoUOM = (value: any, uom: number) => {
|
|||||||
switch (uom) {
|
switch (uom) {
|
||||||
case DeviceValueUOM.NONE:
|
case DeviceValueUOM.NONE:
|
||||||
if (typeof value === 'number') {
|
if (typeof value === 'number') {
|
||||||
return new Intl.NumberFormat().format(value);
|
return Number(value);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
case DeviceValueUOM.DEGREES:
|
case DeviceValueUOM.DEGREES:
|
||||||
case DeviceValueUOM.DEGREES_R:
|
case DeviceValueUOM.DEGREES_R:
|
||||||
case DeviceValueUOM.FAHRENHEIT:
|
case DeviceValueUOM.FAHRENHEIT:
|
||||||
return new Intl.NumberFormat(undefined, {
|
return Number(value).toFixed(1);
|
||||||
minimumFractionDigits: 1
|
|
||||||
}).format(Number(value));
|
|
||||||
default:
|
default:
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user