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');
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?
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 !!!!
Forum related to Firebird
2 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest