WC_Gateway_Paypal_Request::round()protectedWC 1.0

Round prices.

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

Хуков нет.

Возвращает

double.

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

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

Код WC_Gateway_Paypal_Request::round() WC 8.7.0

protected function round( $price, $order ) {
	$precision = 2;

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

	return NumberUtil::round( $price, $precision );
}