The template for the #cost column should be something like
Code:
program:
v = add(raw_field('#c'), raw_field('#credit'));
format_number(v, '${0:5,.2f}')
Using template program mode is required because the number format contains the { and } characters. Using raw_field instead of field is required because the #c or the #credit columns are themselves formatted and contain non-numeric characters.