ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formatting complex number display (https://www.excelbanter.com/excel-discussion-misc-queries/127123-formatting-complex-number-display.html)

Lewis

Formatting complex number display
 
Hello there in never never land.
Can someone help me in formatting complex numbers.
How do I get the following simple "complex" function to display as "-1+0i",
rather than
-1+1.22514845490862E-016i ?
function : =+COMPLEX(COS(PI()),SIN(PI()))
--
Lewis
Engineering Solutions


Gary''s Student

Formatting complex number display
 
Why not just test the size of the imaginary part and if it is really, really
small force the display of 0?:

=IMREAL(A1)&IF(ABS(IMAGINARY(A1))<0.0000000001,"+0 i",IMAGINARY(A1))

will display:
-1+0i
if A1 contains:
=+COMPLEX(COS(PI()),SIN(PI()))

--
Gary's Student
gsnu200702


"Lewis" wrote:

Hello there in never never land.
Can someone help me in formatting complex numbers.
How do I get the following simple "complex" function to display as "-1+0i",
rather than
-1+1.22514845490862E-016i ?
function : =+COMPLEX(COS(PI()),SIN(PI()))
--
Lewis
Engineering Solutions



All times are GMT +1. The time now is 02:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com