
| Current Path : /var/www/html/store/web/modules/contrib/commerce/modules/price/src/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/store/web/modules/contrib/commerce/modules/price/src/MinorUnitsConverterInterface.php |
<?php
namespace Drupal\commerce_price;
/**
* Allows converting between Price objects (decimal) and minor units (integer).
*/
interface MinorUnitsConverterInterface {
/**
* Converts an amount in "minor unit" to a decimal amount.
*
* For example, 999 USD becomes 9.99.
*
* @param int|string $amount
* The amount in minor unit.
* @param string $currency_code
* The currency code.
*
* @return \Drupal\commerce_price\Price
* The decimal price.
*/
public function fromMinorUnits($amount, $currency_code): Price;
/**
* Converts the given amount to its minor units.
*
* For example, 9.99 USD becomes 999.
*
* @param \Drupal\commerce_price\Price $amount
* The amount.
*
* @return int
* The amount in minor units, as an integer.
*/
public function toMinorUnits(Price $amount): int;
}