devxlogo

String to Float

String to Float

Question:

How do I add two label values together and submit the answer to another label?

Label19.Caption := FloatToStrF(Table1Standard.AsFloat,ffCurrency,15,2)Label20.Caption := FloatToStrF(Table1Zero.AsFloat,ffCurrency,15,2)Label21.Caption := StrToFloat(?????????

Answer:

This is one of those things that you’ll kick yourself for not seeing right away. The answer is:

FloatToStr(MyFloatValue);

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist