python - Formatting Complex Numbers -


for project in 1 of classes have output numbers 5 decimal places.it possible output complex number , unable figure out how output complex number 5 decimal places. floats know just:

print "%0.5f"%variable_name

is there similar complex numbers?

for questions this, python documentation should first stop. specifically, have @ section on string formatting. lists string format codes; there isn't 1 complex numbers.

what can format real , imaginary parts of number separately, using x.real , x.imag, , print out in a + bi form.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -