ToNumber
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.
Note: this function uses the language setting of a portal when converting text.
Returns the number converted from text or a unit from date.
Returns Invalid expression when text is not a number, or when reference is not a valid RowId, or when date is not a valid date value or unit is not a valid date unit.
Syntax
ToNumber(text)
ToNumber("1.34")
=> 1.34
ToNumber("a123b456")
=> Invalid expression
ToNumber(unknowntext)
=> unknown
ToNumber(reference)
ToNumber([reference-field to currentrow of a list])
=> [the numeric ID value of the current row]
ToNumber(date, date_unit)
ToNumber(date(2015,9,26,15,46,29), day)
=> 269
ToNumber()
=> Invalid expression
ToNumber(duration, duration_unit)
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
text
text
☑️
a text containing a number.
reference
reference
☑️
reference field, holding a rowid of a list.
date
date
☑️
a 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?