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

Re: "Commifying" a number

by jreades (Friar)
on Dec 12, 2002 at 13:04 UTC ( [id://219312]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    
    ...
    print STDOUT "Out: " . reverse($out) . "\n";
    
    exit 0;
    
  2. or download this
    In: 1234567890
    Reversed: 0987654321
    Array: '098' - '' - '765' - '' - '432' - '1'
    Out: 1234,567,890
    
  3. or download this
    my $out = substr(reverse(join("", map { $_ eq "" ? '' : $_ . ',' } spl
    +it/(\d{3})/, reverse($number))), 1);
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-23 22:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found