wc_trim_zeros()
Trim trailing zeros off prices.
Хуков нет.
Возвращает
Строку
.
Использование
wc_trim_zeros( $price );
- $price(строка|float|int) (обязательный)
- Price.
Код wc_trim_zeros() wc trim zeros WC 8.7.0
function wc_trim_zeros( $price ) { return preg_replace( '/' . preg_quote( wc_get_price_decimal_separator(), '/' ) . '0++$/', '', $price ?? '' ); }