Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: A little golf anyone?

by petral (Curate)
on Nov 07, 2002 at 19:55 UTC ( #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
Node Status?
node history
Node Type: note [id://211206]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2020-01-18 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?