woocommerce_tax_round
Round to precision.
Filter example: to return rounding to .5 cents you'd use:
function euro_5cent_rounding( $in ) {
return round( $in / 5, 2 ) * 5;
} add_filter( woocommerce_tax_round, 'euro_5cent_rounding' );
Usage
add_filter( 'woocommerce_tax_round', 'wp_kama_woocommerce_tax_round_filter' ); /** * Function for `woocommerce_tax_round` filter-hook. * * @param $in * * @return */ function wp_kama_woocommerce_tax_round_filter( $in ){ // filter... return $in; }
- $in
- -
Where the hook is called
woocommerce_tax_round
woocommerce/includes/class-wc-tax.php 103
return apply_filters( 'woocommerce_tax_round', NumberUtil::round( $in, wc_get_rounding_precision() ), $in );