Currency problem with Firebird

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
eelias
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 11.07.2013, 00:36

Currency problem with Firebird

Post by eelias »

Hi there,

I am having a weird problem that I could not isolate up to now.

it SEEMS to be like this http://zeoslib.sourceforge.net/viewtopi ... ency#p8901

However I am using 7.0.3-stable with Firbird 1.0 (yes the 1.0 that is right), Delphi XE2 update 4

Everything worked fine up to now, but I found recently one case that got attention, not sure it happened more times, but that one was a Value 4.20 that insist to be 4.19 when saved on the table.

There is no calculations, the value comes from a string. I am using a INSERT on a ZQuery, with many other fields that are doing correct, but this one:

paramByname('VALOR_ITENS').AsCurrency := strtocurr('4.2');

or even

paramByname('VALOR_ITENS').AsString := '4.2';

The field is saved as 4.19 always.

The field is declared as NUMERIC(12,2). Certanly there are other cases, but this is the only that I could see and reproduce easily. I have a lot of fields like that.

It seems some precision problem. How can I avoid that?

Thank you

EDIT: with AsFloat the problem did not happen. I was afraid of using float just because precision with money value. It fixes this particular problem, not sure if the problem happens diferently with other values !!!!
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Currency problem with Firebird

Post by EgonHugeist »

AFAIK is this issue resolved. Don't know the revision anymore.

So please update your Zeos.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply