float to string conversion

deragon at 8d.com deragon at 8d.com
Mon Dec 18 14:00:54 EST 2000


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/



More information about the Python-list mailing list