«Price Format» extension

If you do not need the decimals, then a 100% working solution would be:

  1. Remove your current custom price format modification
  2. Install the “Currenct Format” module.
  3. Setup the “Currenct Format” module in the proper way (hide the decimals, set the needed thousands separator, etc.)

So the total solution price will be $199 + $150.
Also the “Currenct Format” module would overcome your current custom price format modification, so maybe you do not need the step 1, but I do not know it. You can just install the “Currenct Format” module yourself and check it.