On Tue, Jun 9, 2009 at 5:38 PM, stephen_b<redplusbluemakespur...@gmail.com> wrote: > I'd like to convert a list of floats to a list of strings constrained > to one .1f format. These don't work. Is there a better way? > > [".1f" % i for i in l] > or > [(".1f" % i) for i in l]
There's a missing %, this does work... ["%.1f" % i for i in l] Jaime -- (\__/) ( O.o) ( > <) Este es Conejo. Copia a Conejo en tu firma y ayúdale en sus planes de dominación mundial. -- http://mail.python.org/mailman/listinfo/python-list