[david] wrote:
> returns poorly formatted values:

Please explain.

>  >>>str(13.3)
> '13.3'
>  >>>str([13.3])
> '[13.300000000000001]'

This is quite a FAQ.

str of a float returns the float, rounded to decimal precision.

str of a list returns a square brackets enclosed enumeration of the
contents (using repr on them). repr of a float returns the float in
full precision.

Regards,


Björn

-- 
BOFH excuse #442:

Trojan horse ran out of hay

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to