in reply to Re: How to right align outputs of stored data in a variable?
in thread How to right align outputs of stored data in a variable?

Thank you Dave!

I did want the padding to make things a little more spaced out, also apologies for keeping the comments in on my second approach.

I appreciate your help.

-Steven

  • Comment on Re^2: How to right align outputs of stored data in a variable?

Replies are listed 'Best First'.
Re^3: How to right align outputs of stored data in a variable?
by AnomalousMonk (Archbishop) on Feb 05, 2017 at 00:34 UTC

    A slight variation that would entail less space-futzing between the columns would be something like:

    c:\@Work\Perl\monks>perl -wMstrict -le "use List::Util qw(sum); ;; my $Sum = sum my ($FreqP, $FreqN, $FreqZ) = map { int rand 41600 } 0. +.2; ;; my $fmt = qq{%-9s%16d \n}; printf $fmt, 'Freq(Z+):', $FreqP; printf $fmt, 'Freq(Z-):', $FreqN; printf $fmt, 'Freq(0):', $FreqZ; printf $fmt, 'Total:', $Sum; " Freq(Z+): 3107 Freq(Z-): 27423 Freq(0): 3837 Total: 34367


    Give a man a fish:  <%-{-{-{-<