Sorry folks, another Today's dumb question.
Recent events have had me going in circles with the change node.
Base line of the question is this:
Say I am expecting a number value to come in and for what ever reason it is text.
(to clarify)
Say I am expecting 30 and get 30.
My change node has this in it:
Here's the node for perfect clarity:
[
{
"id": "44e43511439631d5",
"type": "change",
"z": "aad05e94.e66068",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "msg.payload * 1000 * 60",
"tot": "jsonata"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "delay",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1070,
"y": 2930,
"wires": [
[
"2409a9f98804fd88",
"9a949d29ccd6c117"
]
]
}
]
So:
set msg.payload to
J: msg.payload * 1000 * 60
Basically making the 30 into 30 minutes. (Yes?)
I did the maths the longer way only for ..... clarity?
Anyway.
So I get a 30 and not a 30 coming in.
I can't do:
J: parseInt(msgmpayload) * 1000 * 60
can I.
I'm suspicious (well, I've tested it and it doesn't work) it can't be done.
But if there is a trick that would allow that it would be handy to know.
Back to what I've just said about the input.
YES
It is sloppy programming.
It was an example that is a good example to ask the question.
NO
I do NOT want to promote such bad practices. But to me the question is there begging.
