wc_remove_number_precision()
Remove precision from a number and return a float.
Хуков нет.
Возвращает
float
.
Использование
wc_remove_number_precision( $value );
- $value(float) (обязательный)
- Number to add precision to.
Список изменений
С версии 3.2.0 | Введена. |
Код wc_remove_number_precision() wc remove number precision WC 7.7.0
function wc_remove_number_precision( $value ) { if ( ! $value ) { return 0.0; } $cent_precision = pow( 10, wc_get_price_decimals() ); return $value / $cent_precision; }