WC_Tax::round( float|int $in )
Round to precision.
Description Description
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’ );
Parameters Parameters
- $in
-
(Required) Value to round.
Return Return
(float)
Source Source
File: includes/class-wc-tax.php
public static function round( $in ) { return apply_filters( 'woocommerce_tax_round', round( $in, wc_get_rounding_precision() ), $in ); }