Message 58428 - Python tracker (original) (raw)
x = complex(1, 2/3) "{0} {0:.5}".format(x) '(1+0.666666666667j) (1+0.'
The complex number is being formatted as if it were a string and simply truncated to 5 characters. I would expect each part of the complex number to be formatted according to the format specifier, i.e., in the case of :.5 to both have 5 digits after the decimal point.