Subject | Re: [IBO] Is CURRENCY field column attributes ignored? |
---|---|

Author | Marco Menardi |

Post date | 2001-11-08T18:08:42Z |

Reading IB6 Data definition guide, you discover that, for IBO6 and

above, numeric data are ALWAYS stored as integer. The precision

determinates if INTEGER or INT64 is used.

Since IBO knows about data byte occupation in the database (SQLSize,

or something like that), EVERY numeric() must be stored as integer.

So there should be a code like:

tmpINT64 := CurrencyFieldValue * (Power10Int(scale))

function Power10Int( const Exponent : integer ) : Extended;

var

i : integer;

begin

if Exponent <> 0 then

begin

Result := 1;

for i := 1 to abs(Exponent) do

Result := 10 * Result;

end;

end;

Are we getting closer the solution?

Regards

Marco Menardi

above, numeric data are ALWAYS stored as integer. The precision

determinates if INTEGER or INT64 is used.

Since IBO knows about data byte occupation in the database (SQLSize,

or something like that), EVERY numeric() must be stored as integer.

So there should be a code like:

tmpINT64 := CurrencyFieldValue * (Power10Int(scale))

function Power10Int( const Exponent : integer ) : Extended;

var

i : integer;

begin

if Exponent <> 0 then

begin

Result := 1;

for i := 1 to abs(Exponent) do

Result := 10 * Result;

end;

end;

Are we getting closer the solution?

Regards

Marco Menardi