This is counterintuitive:

>>> "{:.3}".format(-0.00666762259822)
'-0.00667'
>>> "{:.3f}".format(-0.00666762259822)
'-0.007'
>>> "%.3f" % -0.00666762259822
'-0.007'
>>> "{:.3s}".format(-0.00666762259822)
ValueError Unknown format code 's' for object of type 'float'

Why does the first form display five digits after the decimal point? Why
don't floats support "{:.Ns}"? (I know I can use "{!s}".)

This is using a freshly hg pulled and updated 2.7  branch.

Thx,

S
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to