wc_add_number_precision_deep()
Add precision to an array of number and return an array of int.
Хуков нет.
Возвращает
int|Массив.
Использование
wc_add_number_precision_deep( $value, $round );
- $value(массив) (обязательный)
- Number to add precision to.
- $round(true|false)
- Should we round after adding precision?.
По умолчанию:true
Список изменений
| С версии 3.2.0 | Введена. |
Код wc_add_number_precision_deep() wc add number precision deep WC 11.0.1
function wc_add_number_precision_deep( $value, $round = true ) {
if ( ! is_array( $value ) ) {
return wc_add_number_precision( (float) $value, $round );
}
foreach ( $value as $key => $sub_value ) {
$value[ $key ] = wc_add_number_precision_deep( $sub_value, $round );
}
return $value;
}