Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Separating big numbers with commas

by Anonymous Monk
on Dec 15, 2018 at 22:39 UTC ( #1227307=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    cat ~/.local/bin/commafy
    
    #!/usr/bin/perl -nl
    $_ =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g;
    print;
    
  2. or download this
    $ find /nix/store -cmin -150 | perl -nle '$sum+=-s "$_";END{print $sum
    +}' | commafy
    18,025,136,505
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2020-05-27 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (153 votes). Check out past polls.

    Notices?