wc_format_localized_decimal()WC 1.0

Format a decimal with the decimal separator for prices or PHP Locale settings.

Hooks from the function

Return

String.

Usage

wc_format_localized_decimal( $value );
$value(string) (required)
Decimal to localize.

wc_format_localized_decimal() code WC 8.6.1

function wc_format_localized_decimal( $value ) {
	$locale        = localeconv();
	$decimal_point = isset( $locale['decimal_point'] ) ? $locale['decimal_point'] : '.';
	$decimal       = ( ! empty( wc_get_price_decimal_separator() ) ) ? wc_get_price_decimal_separator() : $decimal_point;
	return apply_filters( 'woocommerce_format_localized_decimal', str_replace( '.', $decimal, strval( $value ) ), $value );
}