|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] Format by example problems |
Date: | Tue, 03 Jun 2014 12:43:59 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 |
Hi Elias,
I guess you need format characters 1, 2 and/or 3 for that: '-12' ⍕ ¯42 42 -42 42 Those cannot be combined with normal text. The decorators are not meant as a shortcut for inserting text into ⍕ but rather to improve formatting of signed numbers such as -42 or (42) or 42 printed in red, which used to be common in bookkeeping, instead of the rather uncommon ¯. You always get a fixed size output, so %d would not work as in printf(). Same for the other dyadic ⍕ variant: 6 2⍕42 42.00 This is very much like %6.2d in C. Generally speaking, use monadic ⍕ for output of variable size and dyadic ⍕ for columns of fixed size. I can't really see that ⎕FMT is adding much value, and we also have FILE_IO with printf() as an alternative. /// Jürgen On 06/03/2014 07:43 AM, Elias Mårtenson wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |