wc_round_discount()WC 1.0

Round discount.

Хуков нет.

Возвращает

float.

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

wc_round_discount( $value, $precision );
$value(double) (обязательный)
Amount to round.
$precision(int) (обязательный)
DP to round.

Код wc_round_discount() WC 6.9.4

function wc_round_discount( $value, $precision ) {
	if ( version_compare( PHP_VERSION, '5.3.0', '>=' ) ) {
		return NumberUtil::round( $value, $precision, WC_DISCOUNT_ROUNDING_MODE ); // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctionParameters.round_modeFound
	}

	if ( PHP_ROUND_HALF_DOWN === WC_DISCOUNT_ROUNDING_MODE ) {
		return wc_legacy_round_half_down( $value, $precision );
	}

	return NumberUtil::round( $value, $precision );
}