Formatting of complex numbers
3 posts
• Page 1 of 1
Formatting of complex numbers
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
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
- Leo
- Posts: 38
- Joined: Mon Sep 18, 2017 12:10 pm
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
- Roger|Dyalog
- Posts: 238
- Joined: Thu Jul 28, 2011 10:53 am
Re: Formatting of complex numbers
Hello Roger,
thank you for the quick help!
Leo
thank you for the quick help!
Leo
- Leo
- Posts: 38
- Joined: Mon Sep 18, 2017 12:10 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group