Search the Community
Showing results for tags 'TUniDBNumberEdit'.
-
How can I perform TUniDBNumberEdit formatting when leaving the field EX: 0.25 -> +0.25 0.2 -> +0.20 In VCL I was formatting +0.00; -0.00 Thanks Zanona
- 5 replies
-
- TUniDBNumberEdit
- formatting
-
(and 1 more)
Tagged with:
-
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
- 1 reply
-
- FormatFloat
- onexit
-
(and 1 more)
Tagged with: