WC_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' );
Method of the class: WC_Tax{}
Hooks from the method
Return
float
.
Usage
$result = WC_Tax::round( $in );
- $in(float|int) (required)
- Value to round.
WC_Tax::round() WC Tax::round code WC 9.5.1
public static function round( $in ) { return apply_filters( 'woocommerce_tax_round', NumberUtil::round( $in, wc_get_rounding_precision() ), $in ); }