to_number

Converts an expression to numeric data type.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X X X

Syntax

numeric to_number(data[,format])
expr              data
string            format

Description

Returns an error if data does not match the specified format.
format (optional) specifies a mask. If none is provided, a default conversion is performed. Refer to the VORTEX Installation and Usage Guide for the valid formats.

Notes

Conversions are performed automatically within TRIMpl. to_number() provides an explicit type conversion and allows format restrictions to be specified. If the datatype of data is datetime, the number of days since January 01, 0000 is returned. To convert to Oracle Julian date, add 1,721,061.

Example

Converts a character string to a numeric. to_number() returns an error if price is greater than 99.99 or has more than two decimal places.
field = to_number(price,"99.99");