@Abs (Formula Language)
Returns the absolute (unsigned) value of a number.
Syntax
@Abs( anyNumber )
Parameters
anyNumber
Number or number list. Any number valid in Notes/Domino, whether positive or negative, whole or fractional, integer or real.
Return value
absoluteValue
Number or number list. The absolute value of anyNumber.
Usage
If the parameter is a list, the function operates on each element of the list, and the return value is a list with the same number of elements.
When you use this function as the Input translation formula for a Number field, you do not have to supply the field with a default value.
You can enter a field name as the anyNumber parameter. If you do, be sure that the field you reference in an @Abs function:
- Is a number field
- Has a default value of zero
Examples
- This example returns 2.16.
@Abs(-2.16)
- This example returns 2.15 and 2.16 in a list.
@Abs(2.15 : (-2.16))
- This example returns 2.16 if the number in the field named Net
is either 2.16 or -2.16.
@Abs(Net)
- This example returns 25 if Score1 = 50 and Score2 = 75, or if
Score1 = 75 and Score2 = 50.
@Abs(Score1 - Score2)
- This formula, for a computed number field called numDays, uses
@Abs to calculate the number of days between two dates, which are
stored in time fields dateA and dateB. @Integer(dateA-dateB) returns
the number of seconds between dateA and dateB, so the formula divides
by 60*60*24 to get days. For example, if dateA is 08/11/95 and dateB
is 09/22/95, the formula returns: 42.
@If( numDays = ""; 0; @Abs( @Integer( dateA - dateB ) / (60 * 60 * 24 ) ) )