Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re: Separating big numbers with commas

by blakem (Monsignor)
on Sep 05, 2001 at 01:26 UTC ( #110162=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -wT
    use strict;
    ...
    
    $number =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g;
    print "N=$number\n";
    
  2. or download this
    N=1234567890.01
    N=1,234,567,890.01
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2021-06-23 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (117 votes). Check out past polls.

    Notices?