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

number

number

The number function constructs an
xs:double
value either from a node that contains a number, or from an atomic value. This function is useful for telling the processor to treat a node or value as a number, irrespective of its declared type, if any.

Syntax

fn:number(arg)
The following table describes the argument for this command:
Argument
Required/ Optional
Description
arg
Required
The atomic value you want to convert to a number. This can be a string representing a number, a numeric type, or
None
.

Return Value

Returns the value indicated by
$arg
or, if
$arg
is not specified, the context item after atomization, converted to an
xs:double
.
The difference between using the
fn:number
function and the
xs:double
constructor is that the
fn:number
function returns the value
NaN
in the case that the argument cannot be cast to a numeric value, whereas the
xs:double
constructor will raise an error.

Examples

The following table lists some sample values and return values:
SAMPLE FUNCTION
OUTPUT
fn:number('29.99')
29.99
fn:number('ABC')
NaN
fn:number(42)
42.0
fn:number( () )
NaN
fn:number(true())
1

0 COMMENTS

We’d like to hear from you!