Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: how to printf a matrix like this

by RichardK (Parson)
on Feb 11, 2014 at 11:46 UTC ( #1074399=note: print w/replies, xml ) Need Help??


in reply to how to printf a matrix like this

The explanation of how to use printf formatting is in the help for sprintf. (the printf help really should point to this too).

To fix your problem you need to set a minimum width, try something like this :-

printf "%6.1f",$var;

Replies are listed 'Best First'.
Re^2: how to printf a matrix like this
by kcott (Canon) on Feb 12, 2014 at 09:22 UTC
    "The explanation of how to use printf formatting is in the help for sprintf. (the printf help really should point to this too)." [my emphasis]

    The printf documentation does point to this. It starts with:

    "Equivalent to print FILEHANDLE sprintf(FORMAT, LIST), ..."

    [FWIW, madM has already been provided with that information (in Re: printf matrix) as well as example sprintf usage in a number of places.]

    -- Ken

Re^2: how to printf a matrix like this
by madM (Beadle) on Feb 11, 2014 at 12:12 UTC
    thakyou! that really helped :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1074399]
help
Chatterbox?
[Lady_Aleena]: This evening, I thought to myself, "I would love to search Netflix for 100 randomfilms from my database to see if they have them." So I went to CPAN to see if there were a modiule which could do such a thing. There is, but GUH! ...
[Lady_Aleena]: ... Does it have to be that hard and complex to use to do a search on Netflix?
Lady_Aleena grumbles.
[Lady_Aleena]: I really need to get back into the swing of Perl. I'm forgetting things from lack of use. I don't know how behind I am too.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2017-01-21 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (180 votes). Check out past polls.