WordPress at Your Fingertips
function is not described

wc_add_number_precision_deep() WC 3.2.0

Add precision to an array of number and return an array of int.

No Hooks.

Return

Int|Array.

Usage

wc_add_number_precision_deep( $value, $round );
$value(array) (required)
Number to add precision to.
$round(true|false)
Should we round after adding precision?.
Default: true

Changelog

Since 3.2.0 Introduced.

Code of wc_add_number_precision_deep() WC 5.6.0

function wc_add_number_precision_deep( $value, $round = true ) {
	if ( ! is_array( $value ) ) {
		return wc_add_number_precision( $value, $round );
	}

	foreach ( $value as $key => $sub_value ) {
		$value[ $key ] = wc_add_number_precision_deep( $sub_value, $round );
	}

	return $value;
}