Currency problem with Firebird

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

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

Currency problem with Firebird

Postby eelias » 17.10.2013, 21:29

Hi there,

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

it SEEMS to be like this viewtopic.php?f=36&t=2232&p=8901&hilit=currency#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 Dev Team
Zeos Dev Team
Posts: 1701
Joined: 31.03.2011, 22:38

Re: Currency problem with Firebird

Postby EgonHugeist » 18.10.2013, 07:48

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

So please update your Zeos.
King regards, Michael

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

Image


Return to “Firebird”

Who is online

Users browsing this forum: No registered users and 1 guest