How do I get absolute value of a number?
-
I know this should be very easy but is there a block to do this? If not can someone give me the custom code to convert a value into its absolute value?
e.g. of what I am looking for:
I will have a variable for the value could be a position number or a negative number. I want to convert this always in a positive number.
-3 should become 3
3 should stay 3
-5.987 should become 5.987 -
lets say you have variable varNumber and this must be converted to absolute value, than
use custom code block with this code inside:varNumber=MathAbs(varNumber);
-
Thank you.
-
If I was to look at the difference between two moving averages and put those values into a variable, how do I position my blocks to include the varNumber=Math
Abs(varNumber) into a variable? Is there an order to which I would do that? and when it comes time to compare the values in a condition block, do I use a variable or do I use custom code blocks? -
I replied to your question in the other thread.
