woocommerce_format_decimal

The WooCommerce woocommerce format decimal function.

Description

woocommerce_format_decimal( (number) $number, (constant) $dp = false, (bool) $trim_zeros = false ); 

Parameters (3)

0. $number (number)
The number.
1. $dp — Optional. (constant) => false
The dp.
2. $trim_zeros — Optional. (bool) => false
The trim zeros.

Usage

  1. if ( !function_exists( 'woocommerce_format_decimal' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-deprecated-functions.php'; 
  3.  
  4. // The number. 
  5. $number = null; 
  6.  
  7. // The dp. 
  8. $dp = false; 
  9.  
  10. // The trim zeros. 
  11. $trim_zeros = false; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = woocommerce_format_decimal($number, $dp, $trim_zeros); 
  15.  

Defined (1)

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

/includes/wc-deprecated-functions.php  
  1. function woocommerce_format_decimal( $number, $dp = false, $trim_zeros = false ) { 
  2. wc_deprecated_function( __FUNCTION__, '3.0', 'wc_format_decimal' ); 
  3. return wc_format_decimal( $number, $dp, $trim_zeros );