ToNumber

circle-info

The ToNumber() converts a value to a number.

This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.

With Modeler v4.4 and Runtimes v5 (August 2025), the ToNumber function got a new overload that accepts a duration and a duration_unit. Older runtimes will show "invalid expression" when this overload is used.

circle-exclamation
circle-check

Syntax

chevron-rightToNumber(text)hashtag

ToNumber("1.34") => 1.34

ToNumber("a123b456") => Invalid expression

ToNumber(unknowntext) => unknown

chevron-rightToNumber(reference)hashtag

ToNumber([reference-field to currentrow of a list]) => [the numeric ID value of the current row]

chevron-rightToNumber(date, date_unit)hashtag

ToNumber(date(2015,9,26,15,46,29), day) => 269

ToNumber() => Invalid expression

chevron-rightToNumber(duration, duration_unit)hashtag

ToNumber(ToDuration("0.00:02:14.12"), millisecond) => 134120

This implementation only works on Kubernetes Runtimes version 5 and up!

Duration units: day - results in the total number of days hour - results in the total number of hours minute - results in the total number of minutes second - results in the total number of seconds millisecond - results in the total number of milliseconds

Parameters

Name
Type
Required
Description

text

text

☑️

a text containing a number.

reference

reference

☑️

reference field, holding a rowid of a list.

date

date

☑️

a date.

unit

date-unit

☑️

the unitarrow-up-right that is retrieved from date.

duration

duration

☑️

a duration value. supported from runtime v5 invalid expression in older runtimes.

duration_unit

duration-unit

☑️

Duration units: day - results in the total number of days hour - results in the total number of hours minute - results in the total number of minutes second - results in the total number of seconds millisecond - results in the total number of milliseconds

Last updated

Was this helpful?