Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

Table of Contents

Search

  1. Preface
  2. Understanding Data Types and Field Properties
  3. Designing Processes
  4. Using and Displaying Data
  5. Designing Guides
  6. Designing Process Objects
  7. Designing Service Connectors
  8. Using App Connections
  9. System Services, Listeners and Connectors
  10. Designing Human Tasks

Design

Design

abs

abs

Returns the absolute value of a numeric value.

Syntax

fn:abs(arg)
The following table describes the argument for this command:
Argument
Required/Optional
Description
arg
Required
Numeric datatype. Returns the absolute value of a number. You can enter any valid expression.

Return Value

  • If you pass the argument as negative, it returns a negative argument value. Otherwise, returns a positive argument value.
  • If type of argument is one of the four numeric types
    xs:float
    ,
    xs:double
    ,
    xs:decimal
    , or
    xs:integer
    , the type of the result is the same as the type of argument.
  • If the type of argument is a type derived from one of the numeric types, the result is an instance of the base numeric type.
  • NULL if you pass a null value to the function.

Examples

The following table lists some sample values and return values:
SAMPLE FUNCTION
OUTPUT
fn:abs(40)
40
fn:abs(3.5)
3.5
fn:abs(-4)
-4
Null
Null
The following expression returns the difference between two numbers as a positive value, regardless of which number is larger:
fn:abs( PRICE - COST )
PRICE
COST
RETURN VALUE
250
150
100
52
48
4
169.95
69.95
100
70
30
40
430
330
100
100
200
100

0 COMMENTS

We’d like to hear from you!