View Single Post
Old 11-02-2010, 06:39 AM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
shortway to parse numbers with commas in bash?

anyone know a shortway to parse numbers with commas in bash?

ex: 1000
becomes 1,000

and so on

this is what im using, it works, but wondering if theirs anything shorter

Code:
echo 10000 | sed -r ':L;s=\b([0-9]+)([0-9]{3})\b=\1,\2=g;t L'
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote