Python 2.7.5+
The new style '{X.Yf}'.format(num) doesn't seem to act like the old style '%X.Yf'%(num). Can someone explain?
>>> '%8.3f' % (0.98567) ' 0.986' >>> '%8.3f' % (1.98567) ' 1.986' >>> '{num:8.3}'.format(num=0.98567) ' 0.986' >>> '{num:8.3}'.format(num=1.98567) ' 1.99' Note how the old style displays 3 digits after the decimal, but the new style sometimes prints 2 and sometimes 3. Am I making some silly mistake?