WC_Gateway_Paypal_Request::round()protectedWC 1.0

Round prices.

Method of the class: WC_Gateway_Paypal_Request{}

No Hooks.

Return

double.

Usage

// protected - for code of main (parent) or child class
$result = $this->round( $price, $order );
$price(double) (required)
Price to round.
$order(WC_Order) (required)
Order object.

WC_Gateway_Paypal_Request::round() code 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 );
}