Converting a float to a formatted outside of print command

stephen_b redplusbluemakespurple at gmail.com
Mon Nov 23 16:15:07 EST 2009


I'd like to convert a list of floats to formatted strings. The
following example raises a TypeError:

y = 0.5
x = '.1f' % y



More information about the Python-list mailing list