diff --git a/interface/src/project/EMSESPDevicesForm.tsx b/interface/src/project/EMSESPDevicesForm.tsx
index b9bcb422b..9db3de44a 100644
--- a/interface/src/project/EMSESPDevicesForm.tsx
+++ b/interface/src/project/EMSESPDevicesForm.tsx
@@ -118,7 +118,7 @@ export const formatDuration = (duration_min: number) => {
const pluralize = (count: number, noun: string, suffix = 's') =>
` ${count} ${noun}${count !== 1 ? suffix : ''} `;
-function formatValue(value: any, uom: number) {
+function formatValue(value: any, uom: number, digit: number) {
switch (uom) {
case DeviceValueUOM.HOURS:
return value ? formatDuration(value * 60) : '0 hours';
@@ -131,6 +131,14 @@ function formatValue(value: any, uom: number) {
return new Intl.NumberFormat().format(value);
case DeviceValueUOM.BOOLEAN:
return value ? 'on' : 'off';
+ case DeviceValueUOM.DEGREES:
+ return (
+ new Intl.NumberFormat(undefined, {
+ minimumFractionDigits: digit
+ }).format(value) +
+ ' ' +
+ DeviceValueUOM_s[uom]
+ );
default:
return (
new Intl.NumberFormat().format(value) + ' ' + DeviceValueUOM_s[uom]
@@ -313,7 +321,7 @@ class EMSESPDevicesForm extends Component<
{sensorData.id}
- {formatValue(sensorData.temp, DeviceValueUOM.DEGREES)}
+ {formatValue(sensorData.temp, DeviceValueUOM.DEGREES, 1)}
))}
@@ -476,7 +484,7 @@ class EMSESPDevicesForm extends Component<
{item.n}
- {formatValue(item.v, item.u)}
+ {formatValue(item.v, item.u, 0)}
))}