How to import module Math to function node?

Hi there.

I want to take the second root of some variable in the node-red function node.
So I imported "Math" in the setting-tab.
but before I even could sart the srcipt this was my output-error:
image

This is my code:

const input = msg.payload;
msg.payload = Math.sqrt(input);
return msg;

And this is what I've done in the settings:
image

What to do now?
Thanks for help.

Math is a built-in. You do not need to import it or add it to the external modules tab - you can just use it.

1 Like

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