On Fri, 2008-11-21 at 11:02 -0800, [EMAIL PROTECTED] wrote:
> Hello
> 
> I have a perl script that is working fine. The script involves creating an 
> array of numbers. The values of these numbers in the is quite large (12 
> integer digits or more). I can easily display the numbers with a simple print 
> statement. I want to display the contents with one element per line and 
> format it so that it lines up vertically. This is where I am running into 
> issues. I  tried to use a sprintf statement with a format of  "%15u" so that 
> I did not get a negative number. However the value displayed is much smaller 
> than what the actual value. What is the best way to fix this display issue?

Try "%15s" instead; "%15u" seems to cut-off the numbers.

#!/usr/bin/perl

use strict;
use warnings;

my $n = 1;
for my $i ( 1 .. 15 ){
  $n = $n * 10 + $i;
  printf "%15s\n", $n;
}

__END__


-- 
Just my 0.00000002 million dollars worth,
  Shawn

The map is not the territory,
the dossier is not the person,
the model is not reality,
and the universe is indifferent to your beliefs.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to