wc_stock_amount()
Formats a stock amount by running it through a filter.
Hooks from the function
Returns
Int|float.
Usage
wc_stock_amount( $amount );
- $amount(int|float) (required)
- Stock amount.
wc_stock_amount() wc stock amount code WC 10.5.0
function wc_stock_amount( $amount ) {
/**
* Filter the stock amount. If an invalid value is returned by hooks, falls back to intval( $amount ).
*
* @since 2.3
* @param int|float $amount Stock amount.
* @return int|float
*/
return NumberUtil::normalize( apply_filters( 'woocommerce_stock_amount', $amount ), intval( $amount ) );
}