Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!cs.utexas.edu!zaphod.mps.ohio-state.edu!uunet.ca!unixbox!telly!moore!torsqnt!jtsv16!itcyyz!yrloc!hui
From: hui@yrloc.ipsa.reuter.COM (Roger Hui)
Subject: Re: J Format (": ) Questions
Message-ID: <1992Oct24.191855.2079@yrloc.ipsa.reuter.COM>
Organization: Iverson Software Inc.
References: <1992Oct21.043356.26573@csus.edu>
Date: Sat, 24 Oct 92 19:18:55 GMT
Lines: 24

Emmett McLean writes:
 
> If
>    v =. 0.01 9.2 0.0 10.1
> is there a way to print
>    0.01 9.2     10.1
> using fit and format? Or does one have to write a verb which
> searches for strings of 0.*0 and replaces these characters with blanks.
 
   f =. ; @: (,&' '@(0&~: # ":)&.>)
   f 0.01 9.2 0 10.1
0.01 9.2  10.1
 
> Similarly, if  v =. 1 0 3 5
> can I get      001 000 003 005
> without writting a special verb.
 
   g =. , @ (,.&' ') @ (0 2&}.) @ (0.3&":) @ ,. @ (%&1e3)
   g 1 0 3 5
001 000 003 005

------------------------------------
Roger Hui, Iverson Software Inc., 33 Major Street, Toronto, Ontario  M5S 2K9
Phone: (416) 925 6096;  Fax: (416) 488 7559
