Function Node: "TypeError: msg.payload.replaceAll is not a function"

Hey guys!
I am measuring data from the RasPi with an Exec Node. This measurements come as a string with an endline at the end. I used to have a function node wich replaces the \n. I don't know what i have changed but now i get the following debug-message: "TypeError: msg.payload.replaceAll is not a function"
I want to have it in "float" format, not "string"

grafik

Regards,
Jacob

ReplaceAll requires nodejs v15 or greater. What version of node are you running?

1 Like

Try msg.payload.trim() it should remove any white space, including newline.

1 Like

Ps, parseFloat will ignore the carriage return and will just work (iirc)

2 Likes

thanks, works just fine!

i already solved the problem, altough thanks for you answer!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.