D
Daniel Cutter
I thought that printf would allways right justify numbers, unless told
to do differently (with '-'). perlfunc doesn't tell.
#!perl
use strict;
use warnings;
printf("%2.1f\n", 12.3);
printf("%2.1f\n", 4.5);
printf("%02.1f\n", 6.7);
The results are:
12.3
4.5
6.7
But I expected:
12.3
4.5
06.7
What am I missing?
perl -v says:
This is perl, v5.10.0 built for MSWin32-x86-multi-thread
It's Win XP with all the patches
Regards
Daniel Cutter
to do differently (with '-'). perlfunc doesn't tell.
#!perl
use strict;
use warnings;
printf("%2.1f\n", 12.3);
printf("%2.1f\n", 4.5);
printf("%02.1f\n", 6.7);
The results are:
12.3
4.5
6.7
But I expected:
12.3
4.5
06.7
What am I missing?
perl -v says:
This is perl, v5.10.0 built for MSWin32-x86-multi-thread
It's Win XP with all the patches
Regards
Daniel Cutter