float to string conversion

Tyler Eaves tyler at tylereaves.com
Mon Dec 18 14:37:46 EST 2000


On Mon, 18 Dec 2000 19:00:54 GMT, deragon at 8d.com wrote:
return MSISDN + " check FAILED:  $" + str(balance) + errormsg
>Greetings.
>
>
>  I am embarrassed to ask this since it is trivial, but
>  I cannot figure out how to convert a float to a string (obviously,
>  I am new to python).  Somehow, I could not find in the 2.0
>  documentation the syntax to perform the operation.
>
>  The following in my function:
>
>    return MSISDN + " check FAILED:  $" + balance + errormsg
>
>  where balance is a floating number and errormsg is a string
>  generates the following error:
>
>    TypeError: cannot add type "float" to string
>
>
>Sincerely,
>Hans Deragon
>
>
>Sent via Deja.com
>http://www.deja.com/

---
Tyler Eaves

Visit Ultra Coaster Central!
The internet's largest repository
of Ultra Coaster Tracks!

http://www.ultracoastercentral.com


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



More information about the Python-list mailing list