wc_format_localized_decimal

Format a decimal with PHP Locale settings.

Description

(string) wc_format_localized_decimal( (string) $value ); 

Returns (string)

Parameters (1)

0. $value (string)
The value.

Usage

  1. if ( !function_exists( 'wc_format_localized_decimal' ) ) { 
  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_decimal($value); 
  9.  

Defined (1)

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

/includes/wc-formatting-functions.php  
  1. function wc_format_localized_decimal( $value ) { 
  2. $locale = localeconv(); 
  3. return str_replace( '.', $locale['decimal_point'], strval( $value ) );