Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Extended to String? 1

Status
Not open for further replies.

UKChris

Programmer
Jul 2, 2001
5
0
0
US
How do I convert variable of type Extended to a string so that I can put the value in an Edit Control?

I have something like:

var a : extended;
begin
a := 1.123456789123456789;
EditBox.Text := (10 * a);
end;

But it will not convert the Extended to a string for the edit box. I looked at TypeCasts but they didn't seem to make much sense (to me!).

Chris.
 
try this:

var a : extended;

begin
a := 1.123456789123456789;
Edit1.Text := floattostr( (10 * a) );
end;
 
You can also use FormatFloat('0.00',10*a) which allows you to format it however you want, and get rid of pesky E's.

TealWren
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top