Opertions confusion in fromula

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zerosix
    Member
    • Jan 2024
    • 45

    Opertions confusion in fromula

    Hello, in formula $a=1;
    $b=2;
    $c=3;
    output\print($a-$b+$c);​ return -4

    and
    output\printLine($a+$c-$b); reurn 2

    i need a clarification please!
    Click image for larger version

Name:	image.png
Views:	86
Size:	30.4 KB
ID:	103208
  • yuri
    Member
    • Mar 2014
    • 8471

    #2
    I'll look into. You can use "($a - $b) + $c" as a workaround.
    Last edited by yuri; 02-29-2024, 11:05 AM.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment


    • yuri
      yuri commented
      Editing a comment
      In our formula + operator has higher priority than -. We need to fix it in future versions. For now, just resort to parentheses.

    • zerosix
      zerosix commented
      Editing a comment
      Thank you so much, i did line by line to avoid surprises.
      $result=$a+$c;
      $result=$result-$b;
Working...