Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by dbwiz (Curate)
on Jan 09, 2004 at 22:18 UTC ( #320238=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 dbwiz

$number =~ s/(?<=\d)(?=(?:\d\d\d)+\b)/,/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 exploiting the Monastery: (7)
As of 2020-10-27 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (257 votes). Check out past polls.

    Notices?