The current behaviour is still undesirable, though, for two reasons:
if my operation is a subtraction instead of an addition (i.e., use a 'minus" sign instead of a plus sign) and I put no parentheses, the value is correctly set to the difference between the two numbers.
my beloved formatter (sorry for editorializing) does not allow me to put parentheses in the expression. This means that I need to know that this s/b the case and do it in the code editor later.
One could argue that the plus sign is overloaded and that its use as string concatenation takes precedence over its use as algebraic addition whereas the minus sign does not have that problem because it is not overloaded. To avoid getting into a debate over how a language should represent its many operations, I would suggest that Wappler puts a string concatenation function elsewhere, and not in the Operation menu.
This brings me once again to my old rant about the formatter, and the functions bundled under Operations. I already suggested enhancements to the Formatter here and more specifically in point 6 here, more than a year ago – but there has been no traction with any.
I regularly have the same issue - the only way I’ve found to reliably solve it is to always use the toNumber formatter again (I see you used it on the original number). That, or I use setValue multiple times with number as the type.
Did some testing and for me it works fine. When the value is a string and you do not use the toNumber() formatter then it will concatenate and result in 1512. When using the toNumber() formatter to make sure both are number then it the result is 27 as expected.
Seems that the data picker generates the expression incorrect. Instead of generating {{i + 1}} it generates {{i }}1. George will continue on this, when you edit the expression in code then it should work, I’ve tested it with Server Connect PHP.
Hello! Just wanna mention, that problem is still exist. (w 4.0.4)
Tested in formatter for POST variables at server actions in NodeJS.
toNumber() doesn’t helps.
Editing in code doesn’t helps either, because it instantly rewritten after Editor is closed.