Delphi 2007, Delphi XE2 update 2. RODA 6.0.53.935 on both. Relativity Server. Firebird 2.5. FB.NET connection in Relativity.
I am trying to move an app from 2007 to XE2. In my table, I have defined several Decimal fields as Decimal(7,4).
Under 2007, the data from these fields displays as expected. (7.45, 2.25, etc.)
When I recompile the app under XE2, 32 bit they display as as .E1 or .E0.
If I edit the field and set it DecimalPrecision and DecimalScale to the appropriate numbers and set the table active in design time, the fields display as expected. However, in runtime, I get the .E1 or .E0.
Under Schema modler, I attempted to set the Decimal Scale and Decimal Precision data, but it will not save or retain the settings.
Obviously something is different between 2007 and XE2 concerning Decimal fields.
in XE2 they were changed BcdToStrF that is called from TFMTBCDField.GetText. As a result, BcdToStrF produces “E#” values… function BcdToStrF(const Bcd: TBcd; Format: TFloatFormat;
const Precision, Digits: Integer; FS: TFormatSettings): string;
var
LBcd: TBcd;
DecPos: Integer;
begin
LBcd := Bcd;
Result := BcdToStr(LBcd, FS); //<<<< there is correct Result
RoundPrecision(Result, FS.DecimalSeparator, Precision);
DecPos := Pos(FS.DecimalSeparator, Result);
case Format of
ffGeneral: if ((DecPos = 0) and (Length(Result) > Precision)) or (DecPos - 1 > Precision) then
BcdExponentString(Result, Format, FS.DecimalSeparator, Precision, Digits); // Fallback if to big
ffExponent: BcdExponentString(Result, Format, FS.DecimalSeparator, Precision, Digits);
ffFixed,
ffNumber,
ffCurrency: BcdNumberString(Result, Format, Precision, Digits, FS);
end;
end;
pls drop email to support@ in which specify your login for my.remobjects.com.
We’ll include link in your downloads to new Relativity in which problem with DecimalPrecision/DecimalScale was fixed.
hmm, I can’t reproduce original problem with “Relativity - 6.0.54.962-VULCAN-stable 20111209-073543” which was put to your downloads.
I’ve updated DecimalScale&DecimalPrecision for Price and Total fields in OrderDetails table (Relativity|PCTrade Sample domain->PCTrade schema).
After this I’ve created XE2 client from scratch for OrderDetails table
Could you reproduce original problem with this table if you repeated my steps?