Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by hanspoo (Initiate)
on Oct 26, 2004 at 19:44 UTC ( [id://402850]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to How do I print a large integer with thousands separators?

$num = 123456789; $num = reverse $num; # reverse the number's digits $num =~ s/(\d{3})/$1,/g; # insert comma every 3 digits, from beginning $num = reverse $num; # Reverse the result $num =~ s/^\,//; # remove leading comma, if any

Replies are listed 'Best First'.
Re: Answer: How do I print a large integer with thousands separators?
by stevecomrie (Beadle) on Oct 27, 2004 at 08:18 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://402850]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.