Back to List
Placeholder | Replace With |
num | A number value for which you want the absolute value returned. Can be a Number variable or a fixed number value. |
Using the absolute value expression, you can find the absolute value of a given number. You can calculate a negative number, but have it appear as a positive number.
For example, you may need to send a notice to a client about an account balance. Not knowing whether it will be a positive or negative balance, you would create the computation AbsoluteValueOfFinalBalance, which would return a positive expression, regardless. The computation script is:
absoluteValue( FinalBalance )
Once you have created the computation, you can use an if/else expression to merge the desired text with the correct value in the document:
[if:FinalBalance < 0:Your account is $[AbsoluteValueOfFinalBalance] overdrawn./else: You have $[AbsoluteValueOfFinalBalance] in your account.
]
Back to List