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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I convert float to string?

Status
Not open for further replies.

slowbob

Technical User
Dec 15, 2000
7
NL
I need to do some special formating on a float.
The only answer I can think of is converting to a string
then modify string.
Somthing like Basic sVar = STR(fVar)
 
Use the Common way:

sprintf(text,"%f",floatvalue)

hnd
hasso55@yahoo.com

 
Thanks,
Sometimes the simplest things are the most difficult.
I just saw another thread with the same question on
an integer.
I don't think its obvious that sprintf is so flexable.
I assumed (wrongly) that print would only go to a device.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top