Formats a string as a comma-separated number.