Please note the following code
var
fPrice:Currency;
begin
//UniDAC
fZJE:=0.185;
UniQuery1.Append;
UniQuery1.FieldByName('fPrice').AsCurrency:=fPrice;
ShowMessage(FloatToStr(UniQuery1.FieldByName('fPrice').AsCurrency));
//Result is 0.18
//ADO
ADOQuery1.Append;
ADOQuery1.FieldByName('fPrice').AsCurrency:=fPrice;
ShowMessage(FloatToStr(ADOQuery1.FieldByName('fPrice').AsCurrency));
//Result is 0.185
//BDE
Query1.Append;
Query1.FieldByName('fPrice').AsCurrency:=fPrice;
ShowMessage(FloatToStr(Query1.FieldByName('fPrice').AsCurrency));
//Result is 0.19
//fPrice FieldType is Numeric(12,2)
________
Apple games
Decimal problem
Decimal problem
Last edited by cxg417 on Tue 15 Feb 2011 14:57, edited 1 time in total.
f we can add an attribute as an option is equal to 0.18 or 0
Yes! Delphi sure there is such a treatment!
However, in general we all hoped that the outcome is equal to = 0.19.
I think that if we can add an attribute as an option is equal to 0.18 or 0.19 is not better?
For example: default is 0.19, you can also choose to use delphi algorithm 0.19
However, in general we all hoped that the outcome is equal to = 0.19.
I think that if we can add an attribute as an option is equal to 0.18 or 0.19 is not better?
For example: default is 0.19, you can also choose to use delphi algorithm 0.19