I can confirm. 32b is OK, 64b app have bug in setting Params.
Please report this Issue in Fpc, most likely some bad type in IBConnection.pp.
This is not firebird (fbclient.dll) bug. Zeos and Ibx save correct data in Db.
FPC 3.2.1
Edited:
Changing test_type2 to numeric(18,4) from numeric(18,8) is OK. Internally in firebird both types will be saved as Int64 with scale of -4 or -8. Numeric(18,4) is same as native FPC Currency type.
Bug is after line 1163 in IBConnection.pp
SQL_INT64:
begin
if VSQLVar^.sqlscale = 0 then
li := AParam.AsLargeInt
else if AParam.DataType = ftFMTBcd then
li := AParam.AsFMTBCD * IntPower10(-VSQLVar^.sqlscale)
else
li := Round(AParam.AsCurrency * IntPower10(-VSQLVar^.sqlscale));
Move(li, VSQLVar^.SQLData^, VSQLVar^.SQLLen);
end;