Updated complex printing

In case the real or the imaginary part is zero, it is not printed
Added tests.