WC_Gateway_Paypal_Request::number_format
Format prices.
Method of the class: WC_Gateway_Paypal_Request{}
No Hooks.
Returns
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.
WC_Gateway_Paypal_Request::number_format() WC Gateway Paypal Request::number format code WC 10.5.0
protected function number_format( $price, $order ) {
$decimals = 2;
if ( ! $this->currency_has_decimals( $order->get_currency() ) ) {
$decimals = 0;
}
return number_format( (float) $price, $decimals, '.', '' );
}