Thanks Devon. I should really set aside some time and read the WIKI. Could have saved some of my hair .... :D
Still, my problem was I didn't realize that I still need to put in the numbers in the 2.0 in 'r<0>2.0'. I erroneously assumed that using 'r<00>' was the correct formatting. Hehehe. There is no defence against ... err... you know what. :P Thanks again. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Devon McCormick Sent: Tuesday, December 04, 2007 9:02 PM To: General forum Subject: Re: [Jgeneral] Need help with 8!:0 I've tried to cover these sort of questions on the wiki : see http://www.jsoftware.com/jwiki/Guides/General_FAQ/Numbers_and_Character_Representations#head-9a1d957ec99d6b945fb7e98b50433d012be3ccc1, for example. On 12/4/07, Chris Burke <[EMAIL PROTECTED]> wrote: > > Alex Rufon wrote: > > Now I get it ... when I was trying out the new format function I > > wasn't > passing it the complete parameters like so: > > NB. convert to zero padded 2 digits > > 'r<00>' 8!:0 2 > > |rank error > > | 'r<00>' 8!:0 2 > > > > So now I can just write my zero pad function as: > > zeropad=: dyad define > > ('r<0>' append (format x) append '.0') (8!:2) y > > ) > > > > 5 zeropad 3 > > 00003 > > > > 5 zeropad each increment integers 10 > > ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ > > │00001│00002│00003│00004│00005│00006│00007│00008│00009│00010│ > > └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ > > > > This is great! Thanks again. :) > > If you are formatting several values, use 8!:0, and not 8!:2 with > each, e.g. > > 'r<0>5.0' (8!:0) i.6 > +-----+-----+-----+-----+-----+-----+ > |00000|00001|00002|00003|00004|00005| > +-----+-----+-----+-----+-----+-----+ > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail
---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
