<div dir="ltr"><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">It just means significant digits in the general format, which alternates between 10-exponent notation and plain decimal notation.</span><br style="font-size:13.1999998092651px;line-height:19.7999992370605px"><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><a href="https://docs.python.org/3.4/library/string.html#format-specification-mini-language">https://docs.python.org/3.4/library/string.html#format-specification-mini-language</a><br></div><br style="font-size:13.1999998092651px;line-height:19.7999992370605px"><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">    >>> '{:.3}'.format(0.0000356785)</span><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">    '3.57e-05'</div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">    >>> '{:.3}'.format(0.00356785)</div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">    '0.00357'</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, 8 Jun 2015 at 22:33 Skip Montanaro <<a href="mailto:skip.montanaro@gmail.com">skip.montanaro@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">This is counterintuitive:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra"><div class="gmail_extra">>>> "{:.3}".format(-0.00666762259822)  </div><div class="gmail_extra">'-0.00667'</div><div class="gmail_extra">>>> "{:.3f}".format(-0.00666762259822)</div><div class="gmail_extra">'-0.007'</div><div class="gmail_extra">>>> "%.3f" % -0.00666762259822</div><div class="gmail_extra">'-0.007'</div><div class="gmail_extra">>>> "{:.3s}".format(-0.00666762259822)</div><div class="gmail_extra">ValueError Unknown format code 's' for object of type 'float'</div><div><br></div></div><div class="gmail_extra">Why does the first form display five digits after the decimal point? Why don't floats support "{:.Ns}"? (I know I can use "{!s}".)</div><div class="gmail_extra"><br></div><div class="gmail_extra">This is using a freshly hg pulled and updated 2.7  branch.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thx,</div><div class="gmail_extra"><br></div><div class="gmail_extra">S</div><div class="gmail_extra"><br></div><div><br></div></div></div>
--<br>
<a href="https://mail.python.org/mailman/listinfo/python-list" target="_blank">https://mail.python.org/mailman/listinfo/python-list</a><br>
</blockquote></div>