TO_NUMBER: Converting a Character String to a Numeric Value

How to:

TO_NUMBER converts a character string that contains a valid number consisting of digits and an optional decimal point to the numeric format most appropriate to the context. If the value does not represent a valid number, zero (0) is returned.

Syntax: How to Convert a Character String to a Number

TO_NUMBER(string)

where:

string
Is a character string enclosed in single quotation marks or a character field that represents a number containing digits and an optional decimal point. This string will be converted to a double-precision floating point number.

Example: Converting a Character String to a Number

TO_NUMBER converts the string '56.78' to a number with one decimal place.

TO_NUMBER('56.78')

The result is 56.8.

WebFOCUS

Feedback