WordPress at a glance
function is not described

wc_format_sale_price() WC 3.0.0

Format a sale price for display.

Hooks from the function
Return

String. Nothing.

Usage

wc_format_sale_price( $regular_price, $sale_price );
$regular_price(string) (required)
Regular price.
$sale_price(string) (required)
Sale price.

Changelog

Since 3.0.0 Introduced.

Code of wc_format_sale_price() WC 5.3.0

<?php
function wc_format_sale_price( $regular_price, $sale_price ) {
	$price = '<del aria-hidden="true">' . ( is_numeric( $regular_price ) ? wc_price( $regular_price ) : $regular_price ) . '</del> <ins>' . ( is_numeric( $sale_price ) ? wc_price( $sale_price ) : $sale_price ) . '</ins>';
	return apply_filters( 'woocommerce_format_sale_price', $price, $regular_price, $sale_price );
}