WordPress at Your Fingertips
function is not described

wc_round_discount() WC 1.0

Round discount.

No Hooks.

Return

float.

Usage

wc_round_discount( $value, $precision );
$value(double) (required)
Amount to round.
$precision(int) (required)
DP to round.

Code of wc_round_discount() WC 5.8.0

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 );
}