in reply to Re: Perl Problems with Digit Precision Changing on the Printf Statement
in thread Perl Problems with Digit Precision Changing on the Printf Statement

I want the output from
my $value = "0.03443762"; $digitprecision = 20; printf STDOUT ("\n%20s\n", $newvalue);
I want the this printf statement to print exactly as it is
output 0.03443762
so how do i program this using $digitprecision = 20; I need to control the number of spacing using a variable

Replies are listed 'Best First'.
Re^3: Perl Problems with Digit Precision Changing on the Printf Statement
by Roy Johnson (Monsignor) on Jun 24, 2004 at 17:42 UTC
    Just like you did, or like I responded:
    # You did this, and it works: printf STDOUT ("\n%" . $digitprecision . "s\n", $newvalue); # I suggested this, and it works, too: printf STDOUT ("\n%${digitprecision}s\n", $newvalue);

    We're not really tightening our belts, it just feels that way because we're getting fatter.
      thanks!!!!!!!