Convert a negative number into a positive number


#1

1) Give a description of the problem
I have a variable that often changes, but is always a negative number.
ie: -36 or -22 etc
I would like to make a second variable with the positive version of the number
ie: -36 into 36, or -22 into 22

This sounds simple, but I cannot find any reference to this anywhere.


#2

If num < 0

Then
Set newnum num*(-1)
End if

Or…

abs
Syntax
decimal abs(decimal value)
Returns
Returns the absolute value of the argument (e.g., remove negative sign for negative values).


#3

Thanks for the quick reply. abs was what I was looking for… although I cannot believe I forgot that multiplying by -1 would work as well. Thanks @Gopack2!