AbstractSchema::prepare_money_response( string|float $amount, int $decimals = 2, int $rounding_mode = PHP_ROUND_HALF_UP )

Convert monetary values from WooCommerce to string based integers, using the smallest unit of a currency.


Description Description


Parameters Parameters

$amount

(Required) Monetary amount with decimals.

$decimals

(Optional) Number of decimals the amount is formatted with.

Default value: 2

$rounding_mode

(Optional) Defaults to the PHP_ROUND_HALF_UP constant.

Default value: PHP_ROUND_HALF_UP


Top ↑

Return Return

(string) The new amount.


Top ↑

Source Source

File: packages/woocommerce-blocks/src/StoreApi/Schemas/AbstractSchema.php


			

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.