Hello DyalogAPL'er,
How to write Format Commands for Complex Numbers for an Output Log?
Example:
Instead of
2.500000000E000J4.330127019
should in the result list appear
2.5000J4.330
or
2.50E0J4.33E1
Many thanks in advance for your help!
Leo
Formatting of complex numbers
-
- Posts: 238
- Joined: Thu Jul 28, 2011 10:53 am
Re: Formatting of complex numbers
One way: format the real and imaginary parts separately, then combine. For example:
y←2.5j4.330127019
¯3{1↓∊⍺{'J',1↓⍺⍕⍵}¨9 11○⍵}y
2.50E0J4.33E0
3{1↓∊⍺{'J',1↓⍺⍕⍵}¨9 11○⍵}y
2.500J4.330
Re: Formatting of complex numbers
Hello Roger,
thank you for the quick help!
Leo
thank you for the quick help!
Leo