Support » Plugin: WooCommerce » Set rounding precision for internal WC calculations

  • Hello,

    I have this issue:

    Total
    1,75€ (con IVA)
    17,00€ (con IVA)
    1,75€ (con IVA)
    Subtotal 20,51€ (con IVA)

    I solved it by adjusting the rounding precision for internal WC calculations to 2 decimals:

    function wc_get_rounding_precision() {return 2;}

    Can I make this modification out of woocommerce?

    Thanks.

    • This topic was modified 5 years, 3 months ago by pedro82.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Do not modify any plugins file. After plugin update all you changes will gone. Add this code to wp-config.php file: define( 'WC_ROUNDING_PRECISION', 2 );

    Thread Starter pedro82

    (@pedro82)

    Thanks, I’ve tried that solution, but it does not work for me, it gives a notice:

    Notice: Constant WC_ROUNDING_PRECISION already defined in … wp-config.php on line 85

    And the value remains in 4.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set rounding precision for internal WC calculations’ is closed to new replies.