From 92e097ff63bc3ab211dc914a1893a95aae0b3f10 Mon Sep 17 00:00:00 2001 From: jujibo Date: Sun, 9 May 2021 08:24:04 +0000 Subject: [PATCH] Support for fmtBCD git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8010 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/jujiboutils/src/jdblabeledfloatedit.pas | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/jujiboutils/src/jdblabeledfloatedit.pas b/components/jujiboutils/src/jdblabeledfloatedit.pas index 0028faafd..9d18e2c74 100644 --- a/components/jujiboutils/src/jdblabeledfloatedit.pas +++ b/components/jujiboutils/src/jdblabeledfloatedit.pas @@ -142,7 +142,7 @@ procedure Register; implementation uses - Math, jdbutils; + Math, FMTBcd, jdbutils; procedure Register; begin @@ -205,7 +205,13 @@ begin Caption := FormatFloat(EditFormat, theValue) else Caption := FloatToStr(theValue); - FDataLink.Field.Value := theValue; + //writeln(FDataLink.Field.FieldDef.DataType); + case FDataLink.Field.FieldDef.DataType of + ftFMTBcd: FDataLink.Field.AsBCD := StrToBCD(FormatFloat('0.'+StringOfChar('0', Decimals), theValue)); + else + FDataLink.Field.Value := theValue; + end; + end else begin