wc_stock_amount

Formats a stock amount by running it through a filter.

Description

(int|float) wc_stock_amount( (number) $amount ); 

Returns (int|float)

Parameters (1)

0. $amount (number)
The amount.

Usage

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

Defined (1)

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

/includes/wc-formatting-functions.php  
  1. function wc_stock_amount( $amount ) { 
  2. return apply_filters( 'woocommerce_stock_amount', $amount );