WordPress at Your Fingertips
function is not described

WC_Gateway_Paypal_Request::number_format() protected WC 1.0

Format prices.

{} It's a method of the class: WC_Gateway_Paypal_Request{}

No Hooks.

Return

String.

Usage

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

Code of WC_Gateway_Paypal_Request::number_format() WC 5.6.0

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

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

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