Automattic\WooCommerce\StoreApi\Schemas\V1\Agentic

CheckoutSessionSchema::amount_to_centsprotectedWC 1.0

Convert amount from decimal to cents.

Method of the class: CheckoutSessionSchema{}

No Hooks.

Returns

Int. Amount in cents.

Usage

// protected - for code of main (parent) or child class
$result = $this->amount_to_cents( $amount );
$amount(string|float) (required)
Amount in decimal.

CheckoutSessionSchema::amount_to_cents() code WC 10.7.0

protected function amount_to_cents( $amount ) {
	return (int) $this->extend->get_formatter( 'money' )->format(
		$amount
	);
}