Some weird math problem


Something odd is about…


Yeah, that’s fun :smile:

So the issue seems to be that your w input is a string and not a number. So javascript will happily add it as a string (“854” + “32” = “85432”) instead of a number.

Noodl doesn’t typecast the inputs to an expression to numbers, to enable expressions to be used for strings as well (e.g. firstName + " " + lastName), but that has the unfortunate side effect of making cases like yours behave… unexpectedly. Javascript doesn’t really takes types all that seriously :slight_smile:

You can fix by doing Number(w) in the expression, or connect w to a number node, and then connect the number node to the expression. Or somehow make w a number at the source.

Maybe we should make it clear on a connection if a value is a string or a number. Right now there’s no way to tell.