wc_round_tax_total()
Round a tax amount.
Hooks from the function
Return
float
.
Usage
wc_round_tax_total( $value, $precision );
- $value(double) (required)
- Amount to round.
- $precision(int)
- DP to round.
Default: wc_get_price_decimals
wc_round_tax_total() wc round tax total code WC 9.6.1
function wc_round_tax_total( $value, $precision = null ) { $precision = is_null( $precision ) ? wc_get_price_decimals() : intval( $precision ); $rounded_tax = NumberUtil::round( $value, $precision, wc_get_tax_rounding_mode() ); // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctionParameters.round_modeFound return apply_filters( 'wc_round_tax_total', $rounded_tax, $value, $precision, WC_TAX_ROUNDING_MODE ); }