CF7 Remove Comma from ‘select’ ‘radio’ and ‘checkbox’ outouts

If your code is working, at least you are seeing a result. Working from there it is good to understand what is happening.

  1. The function is filtering the mail tags by field name and matching only “your-number”. For any other tags, you would need to add further matches.

  2. The work is being done on the value submitted by the user using a built in PHP function: number_format(). This will format a number using its defaults, google the function for its usage.

What you really want to do is just replace commas in the submitted value using str_replace instead of number_format.

Change this:

$replaced = number_format( $submitted );


$replaced = str_replace(',', '', $submitted ); 

You can replace the comma with a space or any character or just omit it as we have here.