Decimal rounding problem fixed?
Posted: 27.03.2013, 18:54
I have been having the decimal rounding problem described here: http://zeos.firmos.at/viewtopic.php?t=3589.
I have been having this problem since the early betas for version 7.0. I have an early beta that didn't have the problem. I have been comparing the old code with the new code to see if I could find what was different that would cause the problem.
In unit ZDbcInterbase6Utils.pas at line 1888 I added the line as indicated:
Adding the line of code makes the decimals work properly.
I am not a programmer so I am not sure whether this is the proper way to fix the problem or not. Maybe it will be helpful in finding a solution.
I have been having this problem since the early betas for version 7.0. I have an early beta that didn't have the problem. I have been comparing the old code with the new code to see if I could find what was different that would cause the problem.
In unit ZDbcInterbase6Utils.pas at line 1888 I added the line as indicated:
Code: Select all
procedure TZParamsSQLDA.UpdateBigDecimal(const Index: Integer; Value: Extended);
var
SQLCode: SmallInt;
begin
CheckRange(Index);
SetFieldType(Index, sizeof(Int64), SQL_INT64 + 1, -4);//added this line makes it work
{$R-}
with FXSQLDA.sqlvar[Index] do
begin
if (sqlind <> nil) and (sqlind^ = -1) then
Exit;
SQLCode := (sqltype and not(1));
if (sqlscale < 0) then
...
I am not a programmer so I am not sure whether this is the proper way to fix the problem or not. Maybe it will be helpful in finding a solution.