zanona Posted September 14, 2017 Posted September 14, 2017 In VCL the command below works perfectly returning +5.00 procedure TForm4.DBEdit1Exit (Sender: TObject); begin DBEdit1.Text: = FormatFloat ('+ 0.00; -0.00', 5); ShowMessage (DBEdit1.Text); end; If I try the same on Unigui it always returns the value of 5! would this be some kind of bug? I looked at the source code and realized it has a validation below! procedure TUniBaseEdit.SetText (AValue: TCaption); begin if IsNumberEdit then begin AValue: = Trim (AValue); CheckBlank (AValue); if FIsBlankValue then begin FChanged: = True; if FValue <> -1 then begin FValue: = -1; DoOnChangeValue; end; SetVCLProperty ('Text', ''); end else Self.Value: = StrToFloat (AValue, FmtSettings); end else begin AValue: = AdjustCase (AValue); if AValue <> InternalText then begin inherited SetText (AValue); FChanged: = True; end; end; end; Can not he respect what happens in the VCL? Thanks Zanona Quote
Abaksoft Posted December 21, 2017 Posted December 21, 2017 Hello Use instead property : DBEdit1.DecimalSeparator:='.'; DBEdit1.DecimalPrecision:=2; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.