woocommerce_internal_rounding_precision
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.
Использование
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.
Список изменений
С версии 8.8.0 | Введена. |
Где вызывается хук
woocommerce_internal_rounding_precision
woocommerce/includes/wc-core-functions.php 2029
return apply_filters( 'woocommerce_internal_rounding_precision', $precision );