Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Answer: How do I print a large integer with thousands separators?

by hdb (Monsignor)
on May 27, 2013 at 19:05 UTC ( #1035452=categorized answer: print w/replies, xml ) Need Help??

Q&A > data formatting > How do I print a large integer with thousands separators? - Answer contributed by hdb

$number = 123456789; $number = reverse join ",", (reverse $number) =~ /(\d{1,3})/g;

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2020-10-27 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (257 votes). Check out past polls.

    Notices?