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
Return Return
(string) The new amount.
Source Source
File: packages/woocommerce-blocks/src/StoreApi/Schemas/AbstractSchema.php