#! /bin/sed

:x
s/\([0-9]\+\)\([0-9]\{3\}\)/\1,\2/
t x

### colorized by sedsed, a SED script debugger/indenter/tokenizer/HTMLizer
### original script: http://sed.sf.net/grabbag/scripts/commify2.sed