wc_format_localized_price

Format a price with WC Currency Locale settings.

Description

(string) wc_format_localized_price( (string) $value ); 

Returns (string)

Parameters (1)

0. $value (string)
The value.

Usage

  1. if ( !function_exists( 'wc_format_localized_price' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-formatting-functions.php'; 
  3.  
  4. // The value. 
  5. $value = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_format_localized_price($value); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-formatting-functions.php  
  1. function wc_format_localized_price( $value ) { 
  2. return str_replace( '.', wc_get_price_decimal_separator(), strval( $value ) );