Consultor Eletrônico



Kbase P75781: The CAST or CONVERT function returns an integer instead of a numeric or decimal value.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   19/04/2004
Status: Unverified

FACT(s) (Environment):

Progress 9.1x

FACT(s) (Environment):

OpenEdge 10.0A

SYMPTOM(s):

The CAST or CONVERT function returns an integer instead of a numeric or decimal value.

CAUSE:

The scale of the numeric or decimal value is not being specified in the CAST or CONVERT function, only the precision.

FIX:

When you convert to numeric
umber/decimal, you need to specify both precision and scale in order to see the decimal digits.

syntax: numeric[ ( precision, [scale] ) ]
precision = maximum number of digits
scale = the number of digits to the right of the decimal point

So you should use something like:
convert('numeric(5,2)', fld1)