DECIMAL function
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Converts an expression of any data type, with the exception of BLOB, CLOB, and RAW, to a DECIMAL value.
Syntax
|
- expression
- The function behaves as described for the following data types:
- If expression is a CHARACTER, then it must be
valid for conversion into a number. Scientific notation format is allowed.
For example,
"1.67"and"1.67E+3"are valid. - If expression is LOGICAL, then the result is
0if expression is FALSE and1if expression is TRUE. - If expression is a DATE, then the result is the number of days from 1/1/4713 B.C. to that date.
- If the value of expression is the Unknown value
(
?), then the result is also the Unknown value (?).
- If expression is a CHARACTER, then it must be
valid for conversion into a number. Scientific notation format is allowed.
For example,
Examples
The following example procedure lets the user enter new values for CreditLimit in a special form. If the user enters the letter a,
the procedure uses the standard a credit of 5000; if the user enters b, the procedure uses a
value of 2000; if the user presses RETURN, the
procedure uses a value of 1000. Otherwise, the user can enter any value for CreditLimit. The DECIMAL function converts the
value entered into a decimal value.
r-decml.p
|
The following example uses the
DECIMAL function to convert a number written
in scientific notation format:
|