avoid strange, long decimals in input field

This commit is contained in:
MichaelDvP
2022-10-04 10:44:19 +02:00
parent 1f96622e74
commit a413ffb9d2

View File

@@ -508,7 +508,7 @@ const DashboardData: FC = () => {
<ValidatedTextField
name="v"
label={deviceValue.id.slice(2)}
value={deviceValue.u ? numberValue(deviceValue.v) : deviceValue.v}
value={typeof deviceValue.v === 'number' ? (Math.round(deviceValue.v * 10) / 10) : deviceValue.v}
autoFocus
multiline={deviceValue.u ? false : true}
sx={{ width: '30ch' }}