>From the little I looked at printf.ijs written by Henry Rich, it looks like
he tried to duplicate the functionality the C language implimentations.

Also, he added new capabilities.

One thing I see that seems not to work is:

In C the following is true.

'0' : Causes printf to use '0' (instead of spaces) to left fill a fixed
length field. For example (assume i = 3) printf("%2d", i) results in " 3",
while printf("%02d", i) results in "03"

So, I would expect that:

'%02d' printf 3 would produce "03" but it actually produces " 3"

Has anybody got this to work?  Maybe I will go through printf.ijs and modify
it so it provides the same basic functionality that printf in C provides.




neitzel wrote:
> 
> Terrence Brannon  wrote:
>>Is there no printf-like functionality available?
> 
> There is:  require 'printf'  and you get Henry Rich's excellent
> utilities.   The script follows scriptdoc conventions and there's
> also a lab for it.
> 
>                                                       Martin
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-convert-a-number-to-a-string--tf4093212s24193.html#a13940498
Sent from the J Programming mailing list archive at Nabble.com.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to