Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Formatting a number

by smokemachine (Hermit)
on Oct 16, 2006 at 20:10 UTC ( [id://578586] : note . print w/replies, xml ) Need Help??


in reply to Formatting a number

perl -e '$num=12345678;$num=~s/(\d{1,3})$//,$num2=(($num)?",":"").$1.$num2 while$num;print$num2'