• I’m building a demo site using this plugin calculator. The precision option does not seem to work. I want 2 decimal places to be shown in calculated results E.G 2.00 result always shows as just 2 or 3.50 result always shown as just 3.5

    I’m using Site Origin Vantage theme and WP 6.3

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author pbosakov

    (@pbosakov)

    Hello, the “precision” option will only round to a shorter precision, i.e. 3.512 will be rounded to 3.51, but 3.5 will not be displayed as 3.50.

    To work around this, you can use the wpcf7calculate jQuery event to trigger post-processing operations after a calculation. You can code your own Javascript function and place it somewhere on your website for this purpose. Here is an example:

    jQuery(function($) {
      $('form').on('wpcf7calculate', function() { 
        $('input.wpcf7-calculation').each(function() {
          $(this).val(parseFloat($(this).val()).toFixed(2));
        });
      });
    });

    Hope that helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Precision Option Not Working’ is closed to new replies.