How can I format numbers in an html table?

How can I format numbers in an html table?

I am building an html table to display how much people have paid, but the numbers are losing their formatting:

  1. application_table = application_table + "<td style='text-align: right;'>" + payment_row.Amount_Local + "</td>";
Amount_Local is a decimal field, because the currency varies between records.  But I can't find a function to add to this code that will display the separation commas to make it more readable.

Any ideas on how to format the output please?