P
paul.dlug
I have encountered what appears to be a bug in ruby's printf/sprintf
This code:
str = "test"
printf "|%010s|", str
Generates this output:
| test|
However in C and perl, the same code generates this output:
|000000test|
The latter output is correct according to the man pages, according to
the ruby doc for printf/sprintf the behavior should be the same.
Has anyone else encountered this? Is there something I'm missing here
or is there a workaround for it if it is a bug?
Thanks,
Paul
This code:
str = "test"
printf "|%010s|", str
Generates this output:
| test|
However in C and perl, the same code generates this output:
|000000test|
The latter output is correct according to the man pages, according to
the ruby doc for printf/sprintf the behavior should be the same.
Has anyone else encountered this? Is there something I'm missing here
or is there a workaround for it if it is a bug?
Thanks,
Paul