wc_format_localized_decimal()
Format a decimal with the decimal separator for prices or PHP Locale settings.
Hooks from the function
Returns
String.
Usage
wc_format_localized_decimal( $value );
- $value(string) (required)
- Decimal to localize.
wc_format_localized_decimal() wc format localized decimal code WC 10.5.0
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 );
}