wc_format_price_range()WC 1.0

Format a price range for display.

Hooks from the function

Return

String.

Usage

wc_format_price_range( $from, $to );
$from(string) (required)
Price from.
$to(string) (required)
Price to.

wc_format_price_range() code WC 8.7.0

function wc_format_price_range( $from, $to ) {
	/* translators: 1: price from 2: price to */
	$price = sprintf( _x( '%1$s – %2$s', 'Price range: from-to', 'woocommerce' ), is_numeric( $from ) ? wc_price( $from ) : $from, is_numeric( $to ) ? wc_price( $to ) : $to );
	return apply_filters( 'woocommerce_format_price_range', $price, $from, $to );
}