woocommerce_internal_rounding_precision filter-hookWC 8.8.0

Filter the rounding precision for internal WC calculations. This is different from the number of decimals used for display. Generally, this filter can be used to decrease the precision, but if you choose to decrease, there maybe side effects such as off by one rounding errors for certain tax rate combinations.

Usage

add_filter( 'woocommerce_internal_rounding_precision', 'wp_kama_woocommerce_internal_rounding_precision_filter' );

/**
 * Function for `woocommerce_internal_rounding_precision` filter-hook.
 * 
 * @param int $precision The number of decimals to round to.
 *
 * @return int
 */
function wp_kama_woocommerce_internal_rounding_precision_filter( $precision ){

	// filter...
	return $precision;
}
$precision(int)
The number of decimals to round to.

Changelog

Since 8.8.0 Introduced.

Where the hook is called

wc_get_rounding_precision()
woocommerce_internal_rounding_precision
woocommerce/includes/wc-core-functions.php 2019
return apply_filters( 'woocommerce_internal_rounding_precision', $precision );

Where the hook is used in WooCommerce

Usage not found.