WC_Gateway_Paypal_Request::number_format()protectedWC 1.0

Format prices.

Метод класса: WC_Gateway_Paypal_Request{}

Хуков нет.

Возвращает

Строку.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->number_format( $price, $order );
$price(float|int) (обязательный)
Price to format.
$order(WC_Order) (обязательный)
Order object.

Код WC_Gateway_Paypal_Request::number_format() WC 8.7.0

protected function number_format( $price, $order ) {
	$decimals = 2;

	if ( ! $this->currency_has_decimals( $order->get_currency() ) ) {
		$decimals = 0;
	}

	return number_format( $price, $decimals, '.', '' );
}