wc_get_price_decimals

Return the number of decimals after the decimal point.

Description

(int) wc_get_price_decimals(); 

Returns (int)


Usage

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

Defined (1)

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

/includes/wc-formatting-functions.php  
  1. function wc_get_price_decimals() { 
  2. $decimals = apply_filters( 'wc_get_price_decimals', get_option( 'woocommerce_price_num_decimals', 2 ) ); 
  3. return absint( $decimals );