Using Large Numbers Numeric(18,4)
Posted: Thu 14 Sep 2006 19:48
Hello All,
I am experimenting with this and have run into an issue.
I need to access a field in an Ora9i table defined as numeric(18,4). ( Using D6, ODAC 5.80 )
I have already turned on the session option EnableNumbers. This allows me to see the number with full precision when accessed with AsString.
However, when accessing it in other ways, the precision is not preserved.
AsFloat - it is subject to the precision of a double. This is expected.
AsCurrency - Format %18.4f
92345678901234.1120
AsBCD - using BCDToStr
92345678901234.112
AsString (which is correct)
92345678901234.1234
If I do the following:
Value: Currency;
Value := StrToCurr(OraQuery1.fieldbyname('verybignum').AsString);
Memo3.Lines.add(format('%18.4f', [Value]));
The precision is preserved.
Is there another means of getting the number from the field as a number?
Best Regards,
Eric
I am experimenting with this and have run into an issue.
I need to access a field in an Ora9i table defined as numeric(18,4). ( Using D6, ODAC 5.80 )
I have already turned on the session option EnableNumbers. This allows me to see the number with full precision when accessed with AsString.
However, when accessing it in other ways, the precision is not preserved.
AsFloat - it is subject to the precision of a double. This is expected.
AsCurrency - Format %18.4f
92345678901234.1120
AsBCD - using BCDToStr
92345678901234.112
AsString (which is correct)
92345678901234.1234
If I do the following:
Value: Currency;
Value := StrToCurr(OraQuery1.fieldbyname('verybignum').AsString);
Memo3.Lines.add(format('%18.4f', [Value]));
The precision is preserved.
Is there another means of getting the number from the field as a number?
Best Regards,
Eric