wc_get_tax_rounding_mode()WC 3.2.4

Get rounding mode for internal tax calculations.

Хуков нет.

Возвращает

int.

Использование

wc_get_tax_rounding_mode();

Список изменений

С версии 3.2.4 Введена.

Код wc_get_tax_rounding_mode() WC 8.7.0

function wc_get_tax_rounding_mode() {
	$constant = WC_TAX_ROUNDING_MODE;

	if ( 'auto' === $constant ) {
		return 'yes' === get_option( 'woocommerce_prices_include_tax', 'no' ) ? PHP_ROUND_HALF_DOWN : PHP_ROUND_HALF_UP;
	}

	return intval( $constant );
}