You've already forked lazarus-ccr
Fix fmtBCD data type
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8009 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -199,7 +199,7 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Math, dateutils;
|
Math, FMTBcd, dateutils;
|
||||||
|
|
||||||
{ TJDbGridStringCtrl }
|
{ TJDbGridStringCtrl }
|
||||||
|
|
||||||
@ -1015,6 +1015,10 @@ begin
|
|||||||
Field.DataSet.Edit;
|
Field.DataSet.Edit;
|
||||||
if decimals > 0 then
|
if decimals > 0 then
|
||||||
theValue := ScaleTo(theValue, fDecimals);
|
theValue := ScaleTo(theValue, fDecimals);
|
||||||
|
if Field.FieldDef.DataType = ftFMTBcd then
|
||||||
|
Field.AsBCD := StrToBCD(FormatFloat('0.' +
|
||||||
|
StringOfChar('0', Decimals), theValue))
|
||||||
|
else
|
||||||
Field.Value := theValue;
|
Field.Value := theValue;
|
||||||
Field.DataSet.EnableControls;
|
Field.DataSet.EnableControls;
|
||||||
updated := True;
|
updated := True;
|
||||||
@ -1083,6 +1087,9 @@ begin
|
|||||||
Field.DataSet.Edit;
|
Field.DataSet.Edit;
|
||||||
if decimals > 0 then
|
if decimals > 0 then
|
||||||
theValue := ScaleTo(theValue, fDecimals);
|
theValue := ScaleTo(theValue, fDecimals);
|
||||||
|
if Field.FieldDef.DataType = ftFMTBcd then
|
||||||
|
Field.AsBCD := StrToBCD(FormatFloat('0.' + StringOfChar('0', Decimals), theValue))
|
||||||
|
else
|
||||||
Field.Value := theValue;
|
Field.Value := theValue;
|
||||||
CellEditor.Text := Field.AsString;
|
CellEditor.Text := Field.AsString;
|
||||||
updated := True;
|
updated := True;
|
||||||
|
Reference in New Issue
Block a user