Consultor Eletrônico



Kbase P111251: Getting different results depending on how a DECIMAL variable is declared
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

SYMPTOM(s):

Getting different results depending on how a variable is declared.

When the variable is declared AS DECIMAL, decimal digits are preserved in the result.

When the variable is declared LIKE <database field>, decimal digits are lost in the result.

The database field used in the LIKE option is declared as DECIMALS 0.

CAUSE:

The variable will inherit DECIMALS 0 when defined LIKE the database field, and when a result is assigned to the variable, it is rounded to the nearest integer.

On the other hand, when declared AS DECIMAL, the variable can store up to 11 decimal digits.

FIX:

This is expected behavior.