Help for this page
echo "$NUM" | sed -r ':a;s/^([-+]?[0-9]+)([0-9]{3})/\1,\2/;ta'
# This function inserts commas into numbers at every 3 digits # and returns the result in a global variable called $STR. ... STR="$PREFIX$NUM$SUFFIX" fi }