@marcelv Ich kann Dir nicht sagen, warum das so ist - entweder kommt das schon so an oder es ist allgemein bekannt, dass Javascript und das ist ja der Unterbau von NodeRed bei der Division solche Ungenauigkeiten aufweist.
Hier findest Du einige solche Beispiele.
Um das ganze zu normalisieren musst Du halt runden auf die gewünschte Zahl. Hier das falsche Rechnen von Javascript wenn Du 5.30/0.1 teilst.
91708128-9ab3-4714-a25b-b1ea9026e1bb-image.png
Hier zum Test:
Spoiler
[
{
"id": "6d825db117977676",
"type": "change",
"z": "7e6af0015415146d",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$round(payload, 3)\t",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 490,
"y": 6560,
"wires": [
[
"fbdb916f6d2eae7a"
]
]
},
{
"id": "cbdde4b5e1744372",
"type": "function",
"z": "7e6af0015415146d",
"name": "Division 5.30/0.1",
"func": "msg.payload = 5.30/0.1;\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 6480,
"wires": [
[
"6884d1879fbacb54",
"6d825db117977676"
]
]
},
{
"id": "6884d1879fbacb54",
"type": "debug",
"z": "7e6af0015415146d",
"name": "JS Error",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 540,
"y": 6480,
"wires": []
},
{
"id": "421036d3582817fa",
"type": "inject",
"z": "7e6af0015415146d",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 110,
"y": 6480,
"wires": [
[
"cbdde4b5e1744372"
]
]
},
{
"id": "fbdb916f6d2eae7a",
"type": "debug",
"z": "7e6af0015415146d",
"name": "gerundet",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 720,
"y": 6560,
"wires": []
}
]