i want to calculate the following:
expr $f1+$f2/100 if $f2>50 AND
expr $f1-$f2/100 if $f2<50
how can i put this in one box?
Multiple $f in an if expr
i want to calculate the following:
expr $f1+$f2/100 if $f2>50 AND
expr $f1-$f2/100 if $f2<50
how can i put this in one box?
not too sure, but did you try something like:
[expr if;
$f2>50, $f1+$f2/100,$f1-$f2/100]
??
if that doesn't work, i'm sorry, hopefully someone who knows expr better than i do answers.
this looks like a simple if/else condition, not?
[expr if($f2>50, $f1+$f2/100, $f1-$f2/100)]
or do you mean AND is a logical AND?
@toxonic said:
this looks like a simple if/else condition, not?
Yes, it is, indeed! Thank you, that works!
It was important for me to have several inputs for one expression.
Interesting how i could define ranges like 50 to 100 and 0 to 50 for - and +
[expr if($f2>50<100, $f1+$f2/100);
if($f2>0<50, $f1-$f2/100)]
-> this doesn't work! do you have a suggestion?
okay, i deleted the last posting since it seemed to make no sense.
you can interlace conditions (hope i found the right words, my english....sry), e.g:
if (condition 1 && condition 2), is true then (evaluation 1), is false then (if (condition 3), is true (evaluation 2), is false (evaluation 3)
for your example:
[expr if(($f2>50 && $f2<100), $f1+$f2/100, if($f2<=50 && $f2>0, $f1-$f2/100, 0))]
Oops! Looks like something went wrong!