int

Purpose

Converts arguments to integer numbers. If the argument is a non-whole number, the decimal part is truncated.

This function is the alias for the toint() function.

Syntax

int($group)

Arguments

Requires a single string argument (a named group).

The function cannot accept a constant as an argument.

Returned Value

An integer value.

If the input is not a named group, the function does not return any results.

If the input string does not consist of numbers and thus cannot be transformed into an integer, the result field is shown as empty.

Examples

Dataset

XPDL-rule

Result

I ate 2 pieces of the pie.

rule: r1

{

query: {number()}:1

result: Match = int($1)

}

2

I ate 2.5 pieces of the pie.

2

I ate 2 pieces of the pie.

rule: r1

{

query: {"pie"()}:1

result: Match = int($1)

}

""

I ate 2.5 pieces of the pie.

""