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

Re: A little golf anyone?

by petral (Curate)
on Nov 07, 2002 at 19:55 UTC ( [id://211206]=note: print w/replies, xml ) Need Help??


in reply to A little golf anyone?

OK, this is my final answer:
perl -pe' s!\d{4,}(?=\s)! sprintf$"x($x=-4+length$&) ."%3.*f" .qw(M G T)[$x/3], $x%3<1, $&/1024**int$x/3+1 !ge '
which is 104 chars not counting the decorative white space.

  p

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://211206]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-25 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found