Using math.js plugin

Hey guys,

I think you’ll be able to help me in a second, I just can’t get it to run. I’ve installed the mathjs plugin. I have a simple input field, which I want to use for a simple calculation. The first step ist easy and also works fine (input field times 2).

The second step would be to add 6 to the doubled input, but i can’t get the formula (input*2)+6) to put out the correct result. The output is incorrect and the following is displayed in the Debugger:

Error connecting to MathJS: Error: Value expected (char 3)

Hope you can help

Do you get the expected value on a mathjs expression parser, such as the one on http://mathjs.org/?

Yes, I get the expected value. Even if I leave out the parentheses. Maybe I’m using the wrong syntax in the api call?

I solved it. The ±sign is not regonized somehow! I used the add(x,y) function instead.

1 Like

Possibly it needs to be url-encoded, i.e. the + sign means space, to send a plus send “%2B”.

@vega.andrew can you comment on this?

Thanks! this one wasted a couple of hours of my time until I got to your answer