troubleshooting Question

How to format DBTextEdit (float field) as a percent?

Avatar of Norm-al
Norm-alFlag for United States of America asked on
Delphi
7 Comments1 Solution2084 ViewsLast Modified:
I have a data entry form that has a DBTextEdit field pulling in a float but when I show the form, it needs to show as a percentage. I have this same field in a grid and the procedure I have is the following:

if (AText <> NULL) OR (AText <> '') then begin
    AText := FloatToStr(StrToFloatDef(AText,0) * 100);
    AText := AText + '%';
  end;

I tried this in both the OnValidate and OnNewLookupDisplayText and those did not work... any ideas how to accomplish this? I'm sure it will be simple and I am just overlooking something really silly... thanks for your help!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros