diff --git a/components/jujiboutils/src/jdbgridutils.pas b/components/jujiboutils/src/jdbgridutils.pas index 2c90c88fb..981806b63 100644 --- a/components/jujiboutils/src/jdbgridutils.pas +++ b/components/jujiboutils/src/jdbgridutils.pas @@ -199,7 +199,7 @@ type implementation uses - Math, dateutils; + Math, FMTBcd, dateutils; { TJDbGridStringCtrl } @@ -1015,7 +1015,11 @@ begin Field.DataSet.Edit; if decimals > 0 then theValue := ScaleTo(theValue, fDecimals); - Field.Value := theValue; + if Field.FieldDef.DataType = ftFMTBcd then + Field.AsBCD := StrToBCD(FormatFloat('0.' + + StringOfChar('0', Decimals), theValue)) + else + Field.Value := theValue; Field.DataSet.EnableControls; updated := True; end; @@ -1083,7 +1087,10 @@ begin Field.DataSet.Edit; if decimals > 0 then theValue := ScaleTo(theValue, fDecimals); - Field.Value := theValue; + if Field.FieldDef.DataType = ftFMTBcd then + Field.AsBCD := StrToBCD(FormatFloat('0.' + StringOfChar('0', Decimals), theValue)) + else + Field.Value := theValue; CellEditor.Text := Field.AsString; updated := True; end;