• Resolved Outerbridge

    (@outerbridge)


    Hi

    I have many small products which means that when a coupon is applied the rounding is not accurate enough (using GBP with 2 decimal places being displayed). This means I need wc_get_rounding_precision() to return 6 rather than 4.

    I can’t see a way of doing this as WC_ROUNDING_PRECISION is a constant 4, so would it be possible to add a filter to wc_get_rounding_precision() please?

    E.g.

    function wc_get_rounding_precision() {
    	$precision = wc_get_price_decimals() + 2;
    	if ( absint( WC_ROUNDING_PRECISION ) > $precision ) {
    		$precision = absint( WC_ROUNDING_PRECISION );
    	}
    	apply_filters( 'woocommerce_rounding_precision', $precision );
    	return $precision;
    }

    Many thanks! A great plugin.
    Mike

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Feature request – rounding precision’ is closed to new replies.