DBCalc not summing JIT value that is BCD
I have a variant that contains a BCD value from a query that will not sum. The DBText will display each value but the Sum always returns 0. I am on 20.01
To reproduce you can do this. Create a JIT field with type Extended (no BCD option). An use this to generate values:
function TForm1.JITGetFieldValue(aFieldName: string): Variant;
begin
Result := VarFmtBcdCreate(10);
end;
To reproduce you can do this. Create a JIT field with type Extended (no BCD option). An use this to generate values:
function TForm1.JITGetFieldValue(aFieldName: string): Variant;
begin
Result := VarFmtBcdCreate(10);
end;
Comments
The Delphi unit Data.FMTBcd contains some conversion functions: BcdToDouble, BcdToCurr
uses
Data.FMTBcd;
function TForm1.ppJITPipeline1GetFieldValue(aFieldName: string): Variant;
begin
Result := BcdToDouble(10);
end;
For comparison, the RB DBPipeline converts TFieldType ftBcd and ftFMTBcd to TppField.DataType dtDouble. And when retrieving the value calls TField.AsFloat.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com