wc_round_tax_total

Round a tax amount.

Description

wc_round_tax_total( (mixed) $tax ); 

Parameters (1)

0. $tax (mixed)
The tax.

Usage

  1. if ( !function_exists( 'wc_round_tax_total' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-formatting-functions.php'; 
  3.  
  4. // The tax. 
  5. $tax = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_round_tax_total($tax); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-formatting-functions.php  
  1. function wc_round_tax_total( $tax ) { 
  2.  
  3. // @codeCoverageIgnoreStart 
  4. if ( version_compare( phpversion(), '5.3', '<' ) ) { 
  5. $rounded_tax = round( $tax, $dp ); 
  6. } else { 
  7. // @codeCoverageIgnoreEnd 
  8. $rounded_tax = round( $tax, $dp, WC_TAX_ROUNDING_MODE ); 
  9. return apply_filters( 'wc_round_tax_total', $rounded_tax, $tax, $dp, WC_TAX_ROUNDING_MODE );