Decimal problem
Posted: Tue 22 Sep 2009 11:47
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
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