The “gform_calculation_format_result” filter can be used to override the default formatting for a calculated result.


The gform_calculation_result filter is a JavaScript filter.

gform.addFilter( 'gform_calculation_format_result', function( result, formulaField, formId, calcObj ) {
  // do stuff
  return result;
} );



Format the number field with id 1 as currency.

    gform.addFilter( 'gform_calculation_format_result', function(formattedResult, result, formulaField, formId, calcObj ){    
        if ( formulaField.field_id == '1' ){ // Change 1 to your field id number
          formattedResult = gformFormatNumber(result, !gformIsNumber(formulaField.rounding) ? -1 : formulaField.rounding, ',', '');
        var currency = new Currency(gf_global.gf_currency_config);
        return currency.toMoney(formattedResult);

Show always two decimals.

gform.addFilter('gform_calculation_format_result', function (formattedResult, result, formulaField, formId, calcObj) {
    if (formulaField.field_id == '3') { // Change 3 to your field id number
        var decimalSeparator = ',',
            thousandSeparator = '.',
            currency = new Currency(gf_global.gf_currency_config);
        formattedResult = currency.numberFormat(result, 2, decimalSeparator, thousandSeparator);
    return formattedResult;


Your code snippet can be placed in an HTML field on your form or in a theme custom JavaScript file.

See also the JavaScript/jQuery section in this article: Where Do I Put This Code?

Source Code

This filter is located in js/gravityforms.js.