Can I format a smarty token number to have thousands comma?
The civi provided modifier has a different name: crmNumberFormat

moreover as per Paul-Tahoe analysis, smarty seems to be confused, so the trick is to assign the formatted value to a temporary variable:

{assign var="ttl" value=$contact.total_amount|crmNumberFormat:2:'.':','}

and then display it:{$ttl}