toint

Purpose

Converts a string consisting of numbers to an integer value by ignoring the digits after the decimal point in the string.

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

Syntax

toint($group)

Arguments

Requires a single string argument — a named group.

The function cannot accept a constant as an argument.

Returned Value

An integer value that was obtained by converting the input value to an integer.

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 to 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 = toint($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 = toint($1)

}

“”

I ate 2.5 pieces of the pie.

“”